News:

Wondering if this will always be free?  See why free is better.

Main Menu

Pretty URLs

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

Previous topic - Next topic

Dannii

#2880
Quote from: F.L.A.M.E.R on January 15, 2009, 12:57:51 PM
i did the step actually, but it doesnt open up, it just shows me the blank page.. (the famous one you know! :P)
It's supposed to be blank... did it help?

Quote from: assam_siddibapa on January 16, 2009, 01:10:53 AM
Please support me for this topic
http://www.simplemachines.org/community/index.php?topic=286162.0
Does the error come up repeatedly, or just once when you first installed the mod? Some forums don't seem to install it properly, but once you enable the mod the errors stop.

Quote from: argimiro on January 16, 2009, 01:35:00 AM
Quick question about http return codes;

I'm seeing:

200: http://www. mysite.co.uk/forums
200: http://www. mysite.co.uk/forums/
200: http://www. mysite.co.uk/forums/nonexistent_subfolder_1
200: http://www. mysite.co.uk/forums/nonexistent_subfolder_1/
200: http://www. mysite.co.uk/forums/nonexistent_subfolder_1/nonexistent_subfolder_2
200: http://www. mysite.co.uk/forums/nonexistent_subfolder_1/nonexistent_subfolder_2/
404: http://www. mysite.co.uk/forums/nonexistent_subfolder_1/nonexistent_subfolder_2/nonexistent_subfolder_3

Shouldn't it be returning a 404 error for everything except the first 2?

3,4,5 & 6 are returning a 200 OK status code, and serving the forum index page even though the URL is 'spurious' & doesn't represent any real content. Have I got something messed up somewhere do you guys think? or is this the correct behaviour - it just seems a bit worrying in terms of, maybe it would cause a duplicate content problem on the search engines if they were requesting old dead url's, and kept on getting told, 'yes the page is still there and here it is.. same content as root'.. ?
That's how the mod works... none of them actually exist remember. It just assumes that the URLs are either for boards or topics. If you want, get it to change it to a 404 if it can't find the topic in Display.php

Quote from: simmer on January 16, 2009, 11:45:11 AM
hello  :)

i juss installed Pretty URLs everything was fine bt it is changing the adress of categories

http://mobi-movies.org/index.php/board,2.0.html 

every board index category address changes

to

simmer.xxxxxxxhting.com nd this  was my previous host please tell me how to fix this i tried repairsettings bt everything was fine dre please  reply :)

simmer  :)
http://code.google.com/p/prettyurls/wiki/TroubleShooting
Follow the second section there.

Quote from: glennk on January 17, 2009, 03:23:37 PM
Hi Danii,

Welcome back.

I recently updated to 2b4 and reinstalled your mod. I have one slight problem. Its nothing major but your help would be appreciated. Under the old version your mod created the url below for the main board in my forum

http://www.whitbyseaanglers.co.uk/forum/north-east-coast-fishing/0/

Under the new version in 2b4 your mod creates a slightly different url

http://www.whitbyseaanglers.co.uk/forum/north-east-coast-fishing/

Now its only a small problem but I had built up a small amount of page rank on the first url and had a few internal and external links pointing there. I would like to 301 the old url to the new one but it just doesnt seem to work. Can you give me the code needed to 301 the old url to the new one please and advise on where it needs to go.

Many thanks as always - Glenn
Redirecting them is probably too complicated. What I'd suggest, if you absolutely need to keep the old ones, is to replace the relevant functions of PrettyUrls-Filters.php with code from the older versions.
"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."

Adish - (F.L.A.M.E.R)

Not really, just sent you a PM about the things you might need to know or be useful to understand.  Sorry about that as you havnt invited me to send a PM, although i thought it could be important. :)

simmer


coendeurloo

Hi there, lovely mod! I would like to enable it, but of course: I get an error when I click a pretty URL ;)

I don't have a .htacces in my forum folder (or anywhere it seems?), and I don't see an example.htaccess either, where do I get it? My server should be more than able to use it.

glennk

Hi Dannii,

It really needs to be a 301 as both pages have links in now. It is important for seo that 2 urls for the same page are not created.

Dannii

#2885
Quote from: coendeurloo on January 18, 2009, 07:29:13 AM
Hi there, lovely mod! I would like to enable it, but of course: I get an error when I click a pretty URL ;)

I don't have a .htacces in my forum folder (or anywhere it seems?), and I don't see an example.htaccess either, where do I get it? My server should be more than able to use it.
It should be created automatically. Are you sure it's not there, it is a hidden file and so might not be displayed in FTP or SSH.

Quote from: glennk on January 18, 2009, 07:37:06 AM
Hi Dannii,

It really needs to be a 301 as both pages have links in now. It is important for seo that 2 urls for the same page are not created.
You could try these changes... might work, might not. If it doesn't I don't really have the time to help any more sorry!

Code (find) Select
RewriteRule ^ROOTURL([-_!~*\'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
Code (replace) Select
RewriteRule ^ROOTURL([-_!~*\'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^ROOTURL([-_!~*\'()$a-zA-Z0-9]+)/0/?$ ./index.php?board=$1.0 [L,QSA]

Code (find) Select
RewriteRule ^ROOTURL([-_!~*\'()$a-zA-Z0-9]+)/([-_!~*\'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
Code (replace) Select
RewriteRule ^ROOTURL([-_!~*\'()$a-zA-Z0-9]+)/([-_!~*\'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
RewriteRule ^ROOTURL([-_!~*\'()$a-zA-Z0-9]+)/([-_!~*\'()$a-zA-Z0-9]+)/0/?$ ./index.php?board=$1;topic=$2.0 [L,QSA]

This will redirect /0/ URLs to /. Keep the code in PrettyUrls-Filters.php the same as normal.
"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."

coendeurloo

#2886
Quote from: Dannii on January 18, 2009, 08:39:35 AM
Quote from: coendeurloo on January 18, 2009, 07:29:13 AM
Hi there, lovely mod! I would like to enable it, but of course: I get an error when I click a pretty URL ;)

I don't have a .htacces in my forum folder (or anywhere it seems?), and I don't see an example.htaccess either, where do I get it? My server should be more than able to use it.
It should be created automatically. Are you sure it's not there, it is a hidden file and so might not be displayed in FTP or SSH.


I've got Filezilla as FTP Client, it should be able to see the .htaccess file. Is it generated in the default forum root folder?

I have uninstalled/reinstalled it...no errors, but no .htacces either...

assam_siddibapa

Quote from: assam_siddibapa on January 16, 2009, 01:10:53 AM
Please support me for this topic
http://www.simplemachines.org/community/index.php?topic=286162.0
Does the error come up repeatedly, or just once when you first installed the mod? Some forums don't seem to install it properly, but once you enable the mod the errors stop.




last time i cleard some 15000 pages

Dannii

Quote from: coendeurloo on January 18, 2009, 09:03:22 AMI've got Filezilla as FTP Client, it should be able to see the .htaccess file. Is it generated in the default forum root folder?

I have uninstalled/reinstalled it...no errors, but no .htacces either...
Have a look at the filezilla settings, you might need to turn on viewing hidden files? And yes it should be in the default root folder. My guess is that there's one there already, but PHP can't write to it.

Quote from: assam_siddibapa on January 18, 2009, 10:05:51 AM
last time i cleard some 15000 pages
And it continues to come up after enabling the mod?
"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."

JoshieDaMan

I need a redirecting code for this. There's one feature that aren't working that I have integrated. How to get it to redirect to /index.php?action=chat because it redirected me to /chat and it's not working properly. Only shown the template but not the chat.

coendeurloo

#2890
Quote from: Dannii on January 18, 2009, 07:18:16 PM
Quote from: coendeurloo on January 18, 2009, 09:03:22 AMI've got Filezilla as FTP Client, it should be able to see the .htaccess file. Is it generated in the default forum root folder?

I have uninstalled/reinstalled it...no errors, but no .htacces either...
Have a look at the filezilla settings, you might need to turn on viewing hidden files? And yes it should be in the default root folder. My guess is that there's one there already, but PHP can't write to it.

Quote from: assam_siddibapa on January 18, 2009, 10:05:51 AM
last time i cleard some 15000 pages
And it continues to come up after enabling the mod?

Thanks Dannii, I can see it now. For some reason I can see it in another Filezilla (at work) just fine :) the content is:

# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: January 18, 2009, 15:05

RewriteEngine on

# Rules for: actions
RewriteRule ^(activate|admin|announce|ban|boardrecount|buddy|calendar|cleanperms)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(collapse|convertentities|convertutf8|coppa|deletemsg|detailedversion|display|dlattach)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(dumpdb|editpoll|editpoll2|featuresettings|featuresettings2|findmember|help|helpadmin)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(im|jsoption|jsmodify|lock|lockVoting|login|login2|logout)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(maintain|manageattachments|manageboards|managecalendar|managesearch|markasread|membergroups|mergetopics)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(mlist|modifycat|modifykarma|modlog|movetopic|movetopic2|news|notify)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(notifyboard|optimizetables|packageget|packages|permissions|pgdownload|pm|post)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(post2|postsettings|printpage|profile|profile2|quotefast|quickmod|quickmod2)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(recent|regcenter|register|register2|reminder|removetopic2|removeoldtopics2|removepoll)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(repairboards|reporttm|reports|requestmembers|search|search2|sendtopic|serversettings)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(serversettings2|smileys|smstats|spellcheck|splittopics|stats|sticky|theme)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(trackip|about:mozilla|about:unknown|unread|unreadreplies|viewErrorLog|viewmembers|viewprofile)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(verificationcode|vote|viewquery|who|\.xml)/?$ ./index.php?pretty;action=$1 [L,QSA]

# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

# Rules for: topics
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ ./index.php?pretty;board=$1;topic=$2.$3 [L,QSA]


What is wrong here? The URLs get rewritten just fine but the links go to 404 pages. Do I need the "extension-none" package you are talking about in the first page? If so, where can I get it? I don't see it anywhere.

CueBurn

Quote from: Dannii on April 18, 2008, 06:29:13 AM
Quote from: darkelhaym on April 17, 2008, 02:00:48 PMI did. I also deactivated mod_security, but it didn't work. I have an update on the error though: it seems the bad request is given only for the exclamation point (in boards or topic titles). The rest of the special characters is working fine. Since the problem is only for the exclamation point maybe there's a manual fix I can do. I had to edit some files manually for installation (100% sure I did touch index.php, Display.php, Subs.php and ModSettings.php) so I might have missed something but I don't know where to start from. Thanks again for any help.
If you delete the line with the exclamation mark from Subs-PrettyUrls.php and delete the tables then when you reinstall the mod that should fix the problem. (Delete the line from the file in the archive I mean.)

Is there any chance you could let me know what the line of text I need to delete is please.  Apart from this one niggle, this is an awesome mod.  Cheers!!

_Anthony_

Quote from: coendeurloo on January 19, 2009, 09:24:41 AM
Quote from: Dannii on January 18, 2009, 07:18:16 PM
Quote from: coendeurloo on January 18, 2009, 09:03:22 AMI've got Filezilla as FTP Client, it should be able to see the .htaccess file. Is it generated in the default forum root folder?

I have uninstalled/reinstalled it...no errors, but no .htacces either...
Have a look at the filezilla settings, you might need to turn on viewing hidden files? And yes it should be in the default root folder. My guess is that there's one there already, but PHP can't write to it.

Quote from: assam_siddibapa on January 18, 2009, 10:05:51 AM
last time i cleard some 15000 pages
And it continues to come up after enabling the mod?

Thanks Dannii, I can see it now. For some reason I can see it in another Filezilla (at work) just fine :) the content is:

# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: January 18, 2009, 15:05

RewriteEngine on

# Rules for: actions
RewriteRule ^(activate|admin|announce|ban|boardrecount|buddy|calendar|cleanperms)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(collapse|convertentities|convertutf8|coppa|deletemsg|detailedversion|display|dlattach)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(dumpdb|editpoll|editpoll2|featuresettings|featuresettings2|findmember|help|helpadmin)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(im|jsoption|jsmodify|lock|lockVoting|login|login2|logout)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(maintain|manageattachments|manageboards|managecalendar|managesearch|markasread|membergroups|mergetopics)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(mlist|modifycat|modifykarma|modlog|movetopic|movetopic2|news|notify)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(notifyboard|optimizetables|packageget|packages|permissions|pgdownload|pm|post)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(post2|postsettings|printpage|profile|profile2|quotefast|quickmod|quickmod2)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(recent|regcenter|register|register2|reminder|removetopic2|removeoldtopics2|removepoll)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(repairboards|reporttm|reports|requestmembers|search|search2|sendtopic|serversettings)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(serversettings2|smileys|smstats|spellcheck|splittopics|stats|sticky|theme)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(trackip|about:mozilla|about:unknown|unread|unreadreplies|viewErrorLog|viewmembers|viewprofile)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(verificationcode|vote|viewquery|who|\.xml)/?$ ./index.php?pretty;action=$1 [L,QSA]

# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

# Rules for: topics
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ ./index.php?pretty;board=$1;topic=$2.$3 [L,QSA]


What is wrong here? The URLs get rewritten just fine but the links go to 404 pages. Do I need the "extension-none" package you are talking about in the first page? If so, where can I get it? I don't see it anywhere.
# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: January 18, 2009, 15:05

RewriteEngine on
RewriteBase /

# Rules for: actions
RewriteRule ^(activate|admin|announce|ban|boardrecount|buddy|calendar|cleanperms)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(collapse|convertentities|convertutf8|coppa|deletemsg|detailedversion|display|dlattach)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(dumpdb|editpoll|editpoll2|featuresettings|featuresettings2|findmember|help|helpadmin)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(im|jsoption|jsmodify|lock|lockVoting|login|login2|logout)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(maintain|manageattachments|manageboards|managecalendar|managesearch|markasread|membergroups|mergetopics)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(mlist|modifycat|modifykarma|modlog|movetopic|movetopic2|news|notify)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(notifyboard|optimizetables|packageget|packages|permissions|pgdownload|pm|post)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(post2|postsettings|printpage|profile|profile2|quotefast|quickmod|quickmod2)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(recent|regcenter|register|register2|reminder|removetopic2|removeoldtopics2|removepoll)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(repairboards|reporttm|reports|requestmembers|search|search2|sendtopic|serversettings)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(serversettings2|smileys|smstats|spellcheck|splittopics|stats|sticky|theme)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(trackip|about:mozilla|about:unknown|unread|unreadreplies|viewErrorLog|viewmembers|viewprofile)/?$ ./index.php?pretty;action=$1 [L,QSA]
RewriteRule ^(verificationcode|vote|viewquery|who|\.xml)/?$ ./index.php?pretty;action=$1 [L,QSA]

# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

# Rules for: topics
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ ./index.php?pretty;board=$1;topic=$2.$3 [L,QSA]

The RewriteBase / should fix that.

asmith

Hi,

I changed a member username. now when clicking on his name, forums says username doesn't exists. I fixed this problem but manually changing the url in the pretty urls table cache. Just thought to let you know.

coendeurloo

Quote from: MrMoney on January 20, 2009, 01:20:58 AM
The RewriteBase / should fix that.

Unfortunatly that does not work, the 404 page remains.

_Anthony_

Quote from: coendeurloo on January 20, 2009, 03:12:53 AM
Quote from: MrMoney on January 20, 2009, 01:20:58 AM
The RewriteBase / should fix that.

Unfortunatly that does not work, the 404 page remains.
Where is the .htaaccess located, forum root right?

coendeurloo

Quote from: MrMoney on January 20, 2009, 04:40:32 AM
Quote from: coendeurloo on January 20, 2009, 03:12:53 AM
Quote from: MrMoney on January 20, 2009, 01:20:58 AM
The RewriteBase / should fix that.

Unfortunatly that does not work, the 404 page remains.
Where is the .htaaccess located, forum root right?

That's right. I have a Joomla installation at http://beta.caudata.nl. The forum is located in http://beta.caudata.nl/forum, and the .htaccess is in the forum's root dir.

Dannii

Quote from: JoshieDaMan on January 19, 2009, 05:11:12 AM
I need a redirecting code for this. There's one feature that aren't working that I have integrated. How to get it to redirect to /index.php?action=chat because it redirected me to /chat and it's not working properly. Only shown the template but not the chat.
It is probably using relative URLs. Make sure everything uses full URLs with http://yourdomain.com etc. If that doesn't work I'll look into it more.

coendeurloo, you sure your server supports both mod_rewrite and .htaccess?
Ahh wait, you have Joomla? It probably has a .htaccess file of it's own which is conflicting with the forum's. Can you check that?

CueBurn: '!'   =>   array ('!'),

asmith, ahh yes. Hadn't thought of that. Hopefully will get around to fixing it some day...
"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."

coendeurloo

Quote from: Dannii on January 20, 2009, 04:56:20 AM
coendeurloo, you sure your server supports both mod_rewrite and .htaccess?
Ahh wait, you have Joomla? It probably has a .htaccess file of it's own which is conflicting with the forum's. Can you check that?

Yes - I have a .htaccess in the Joomla root to. Should I put the content of the prettyurls .htaccess in the joomla's .htaccess and put it in the Joomla root?

Dannii

If you post joomla's .htaccess I'll see what can be done...
"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."

Advertisement: