News:

Join the Facebook Fan Page.

Main Menu

Pretty URLs

Started by SMFHacks.com Team, January 31, 2007, 10:56:43 AM

Previous topic - Next topic

runebergen

#2120
Quote from: Dannii on August 05, 2008, 08:39:58 AM
Quote from: runebergen on August 04, 2008, 01:10:11 PM


By the way, I fixed the Simple Portal part...

You are right, that it could be in the root of my site, and that this would give /forum/ for index?action=forum..
But that would make for example Board Hover mod, and relative paths broken I think.
At least Board Hover mod doent work... AS it will be /forum/index.php?xxx  for the URL that mod gives.
How would it be broken?



Sorry, I was inaccurate.. Many mod that uses RELATIVE urls in the code, seems to be broken with Pretty URLS enabled.


One of these are for example Ajax Registration mod. As it sends index.php?action=registration=ajax something

But when Pretty URL is enabled for the actions, the Ajax mod will send
/forum/registration/index.php?action=registration=ajax something

Being relative,  the url /forum/registration/ fails.

Same happened with my Board Hover mod, but only when I have Simple Portal enabled, and Pretty Url for index.php?action=forum for the forum page.
That would make the relative urls in Board Hover mod send this url /forum/forum/index.php?something


But I have fixed both, by making a filter exception for both the action=forum and for action=registration :)

Dont loose sleep over it, if it sounds like a pain to make work :) I've fixed it with filter exceptions.

But maybe there is a way to catch all relative index.php?action= etc, and make it go to the root of the SMS install? And not to the Pretty URL url...(example /forum/xxxx/)

hope it makes sense.

And hope I dont come across as a nag here,  I LOVE YOUR MOD ;) Pretty URLs makes the SMF shine...  not much fan of nasty silly urls ;)

Only meant as some feedbacks, and if it cant be "fixed", no worries :)















Dannii

#2121
After 1.0 is released (hopefully soon... anyone want to help with the graphics?) I will investigate fixing relative URLs. For now the solution is to ask mod authors to change to using absolute URLs.

The arcade is a bit of special case though, because it can be hard, or may not even really be possible, to change to absolute URLs in flash. This is why I'm planning to add something to the extras package for it.
Edit: Okay, I added a filter in the extras package that should allow relative URLs in flash to work... as long as they at least still have "index.php" in them.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

runebergen

Quote from: Dannii on August 05, 2008, 11:56:58 AM

Edit: Okay, I added a filter in the extras package that should allow relative URLs in flash to work... as long as they at least still have "index.php" in them.

*Sounds interesting, might work for the other mods with relative path :)
But if the games are sorted, thats a good plus.. 


As for graphics, hit me up if you wanna.. I work as a Graphic designer, so might help you :)

goldenboy48

#2123
Hello Dannii,

I moved to a new server. I imported my database to the new site. After running repair_settings.php, everything is fine.

But when I install your mod [it was installed when it was on the other server as well], it starts to point to point to old server url again.

I also tried deleted any pretty url tables in database but didn't help. Ran maintenance tasks, didn't help.

Please help.

Dannii

PanesarV, check what value the pretty_root_url setting is (in the smf_settings table.)

runebergen, have you done any web design before? I've started on an admin panel design (as seen in 0.9) but I really don't know where to go from there. If you're interested in helping that would be great, otherwise I'll just do something simple.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

goldenboy48

Quote from: Dannii on August 06, 2008, 05:01:59 AM
PanesarV, check what value the pretty_root_url setting is (in the smf_settings table.)

You are amazing. Changed the URL to the new URL and everything working fine now.

Thank you very much!!!

runebergen

Quote from: Dannii on August 06, 2008, 05:01:59 AM


runebergen, have you done any web design before? I've started on an admin panel design (as seen in 0.9) but I really don't know where to go from there. If you're interested in helping that would be great, otherwise I'll just do something simple.


yes ...;) If you want me to give it a go, let me know.. I'll gladly help, for the great effort you've put into this awesome mod ;)
SMF wouldnt have been the same without it


Dannii

The current files are at http://prettyurls.googlecode.com/svn/trunk/Base/pretty/, chrome.svg is the source file.

I'm planning to add a picture of cherry blossoms (the prettiest thing I can think of that would work for a forum...) to the header, but I don't know waht to do with the menu or other parts on the news page. The settings page is probably fine just as a normal HTML form. If you have any ideas of what would fit in well with the border for the menu, caption and notice box then please do show me. If you want I could give you SVN access too. And... perhaps if you want to take this further maybe start a topic on the dev forum so as to not clutter this topic up too much further?

Thanks!
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

brianjw

Hi,

A couple of the actions aren't being converted to pretty urls...
- ?action=affiliates
- ?action=info
- ?action=staff

I tried to run the maintenance but it doesn't seem to add the actions. ?action=affiliates is the affiliates mod and the other two are actions from the custom actions mod.

It seems this mod might not recognize custom actions with the mod.

Any ideas?
Brian

Dorian

Hey Dannii, why don't you do the URL rewriting stuff in PHP?
So for example you get the $_SERVER[PHP_SELF] and stripe off the domain and forum path stuff and then determine form the remaining URL string which page to display.
Oh and... if the string or topic ID cannot be found send header 404, at least the header...

Just some 2 cents from me. ;)
I'm your creativity creator:)

brianjw

Ok, I am having issues with this mod.

I have a directory on my website which is in /public_html/ and it is called main. If I type in http://www.gamerzgarage.com/main it goes to a blank page on my root SMF forum in /public_html/ instead of going to /main/ as it should. How can I fix this? If I type /main/index.php it loads correctly but I want to fix it for people who don't know to type index.php...

Thanks in advance,
Brian

Dannii

Quote from: brianjw on August 08, 2008, 10:20:47 AMA couple of the actions aren't being converted to pretty urls...
- ?action=affiliates
- ?action=info
- ?action=staff

I tried to run the maintenance but it doesn't seem to add the actions. ?action=affiliates is the affiliates mod and the other two are actions from the custom actions mod.

It seems this mod might not recognize custom actions with the mod.
It gets the list of actions from the list in index.php. I think the custom actions mod doesn't use this list.

Quote from: Dorian on August 08, 2008, 06:38:53 PMHey Dannii, why don't you do the URL rewriting stuff in PHP?
So for example you get the $_SERVER[PHP_SELF] and stripe off the domain and forum path stuff and then determine form the remaining URL string which page to display.
Oh and... if the string or topic ID cannot be found send header 404, at least the header...
Well there's nothing wrong with how it's done now is the simple answer. But I am considering doing this in the future, to make it easier to run on lighttpd and IIS etc.

Quote from: brianjw on August 08, 2008, 08:54:51 PMI have a directory on my website which is in /public_html/ and it is called main. If I type in http://www.gamerzgarage.com/main it goes to a blank page on my root SMF forum in /public_html/ instead of going to /main/ as it should. How can I fix this? If I type /main/index.php it loads correctly but I want to fix it for people who don't know to type index.php...
Do you have a .htaccess file in /public_html/?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

mark7144

I use SEO4SMF but I'm ending up with queries from 26-30 on each page and I've been told it's because of the mod.

Is PrettyURLs any better with queries? Can you give me an idea of the extra queries this mod will produce?

mark7144

Danni said, "You can try editing $scripturl in Querystring.php where it's defined, but it might give you unexpected results. In the future I'll do this automatically."

Please only make that optional as after experimenting, I ended up choosing to force all my forum URLs to use /forum/index.php as forcing it to /forum/ caused a lot of problems.

brianjw

Dannii,
Is there a way to make it get it from the custom actions list as well?

My forum is in /public_html/ and yes I do have a .htaccess in the root of my forum because your mod added it. It seems that if there is a directory inside of the forum root which happens to be /public_html/ and if there is a directory called /main/ then. It will think that /main/ is the name of a board because it comes out as http://www.gamerzgarage.com/main/?pretty;board=main. or something very similar. Anyway to fix this?

(*NOTE*: I uninstalled the mod untill we can solve this problem)

Thanks,
Brian

Assistance

Quote from: mark7144 on August 09, 2008, 05:40:01 AM
Is PrettyURLs any better with queries? Can you give me an idea of the extra queries this mod will produce?
(Pretty URLs adds 0.035s, 1q)
~playing poker~

Dannii

Quote from: mark7144 on August 09, 2008, 05:40:01 AMI use SEO4SMF but I'm ending up with queries from 26-30 on each page and I've been told it's because of the mod.

Is PrettyURLs any better with queries? Can you give me an idea of the extra queries this mod will produce?
It should add between 1-4 queries per page.

Quote from: mark7144 on August 09, 2008, 05:46:03 AMDanni said, "You can try editing $scripturl in Querystring.php where it's defined, but it might give you unexpected results. In the future I'll do this automatically."

Please only make that optional as after experimenting, I ended up choosing to force all my forum URLs to use /forum/index.php as forcing it to /forum/ caused a lot of problems.
Well it will depend on which method I choose to implement and how reliable it is. I'm not planning to actually change $scripturl anymore.

Quote from: brianjw on August 09, 2008, 11:52:07 AMDannii,
Is there a way to make it get it from the custom actions list as well?

My forum is in /public_html/ and yes I do have a .htaccess in the root of my forum because your mod added it. It seems that if there is a directory inside of the forum root which happens to be /public_html/ and if there is a directory called /main/ then. It will think that /main/ is the name of a board because it comes out as http://www.gamerzgarage.com/main/?pretty;board=main. or something very similar. Anyway to fix this?

(*NOTE*: I uninstalled the mod untill we can solve this problem)
So http://www.gamerzgarage.com/ is your SMF installation, and http://www.gamerzgarage.com/main/ is something else that's not part of SMF? Well of course it's thinking it's a board! You'll need to add a rule like this before the others in .htaccess:
RewriteRule ^main/?$ .main/index.php [L,QSA]
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

forumer

Hello Dannii,
thank you very much for this great mod, i installed the mod succesfully and enabled url rewriting in the admin control panel.
but i couldn't make it work on a fresh SMF 2.0 Beta 3.1 Public.

http://www.eslreader.com/beta/general-discussion/welcome-to-smf!/ [nofollow]
this page isn't opening.

What else should i do in order to make it work?

Your help will be appreciated

partners

Hi,

Thanks for the great mod!
We only have small problem.
About once a week  with Pretty URL enabled
the index page will be blank but all the other pages
work fine.
Any ideas what will cause this?

Thanks

JeepJim

I have 2.0 Beta 3.1 installed and its not working for me either...
It rewrote all my urls and none of them work now.

www.realsoldiers.com

Advertisement: