Pretty URLs

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

Previous topic - Next topic

arya

Pretty url is damn good. only problem is when we have images with relative url for an image it goes for a toss. It will be better if we have something like site.com/forums/topic-name-here-0.html [nofollow]

let us know if its possible

cheers
Arya

p.s. : my forums are ported from a ASP portal using SQL export and import directly into smf db. It used lots of relative path for smileys and images which is difficult to change into absolute path.

giggetto

I'm sorry for my bad english.
La mia traduzione del TP 0.98 lingua italiana, ancora beta.

ishan

Just too good !!
Keep it up!

stuartbrandon

Hi eldaka!

I have installed this awasome mod. I need some quick help here. Google is indexing pages like this:

www.mydomain.com/forum/myforum_general_discussion-b1.0/;sort=last_post

www.mydomain.com/forum/myforum_general_discussion-b1.0/;sort=views

as I think it is not good to have this I wonder how can I block them on robots? My old robots looks like this (se below) but I'm not sure if this works now with the new pretty URL installed. What I need to change?

Disallow: /forum/index.php?action=mlist*
Disallow: /forum/index.php?action=who*
Disallow: /forum/index.php?action=post*
Disallow: /forum/index.php?action=admin*
Disallow: /forum/index.php?action=help*
Disallow: /forum/index.php?action=search*
Disallow: /forum/index.php?action=calendar*
Disallow: /forum/index.php?action=login*
Disallow: /forum/index.php?action=register*
Disallow: /forum/index.php?action=profile*
Disallow: /forum/index.php?action=stats*
Disallow: /forum/index.php?action=arcade*
Disallow: /forum/index.php?action=printpage*
Disallow: /forum/index.php?action=reminder*
Disallow: /forum/index.php?action=activate*
Disallow: /forum/index.php?action=viewmembers*
Disallow: /forum/index.php?*rss*
Disallow: /forum/index.php?*wap*
Disallow: /forum/index.php?*wap2*
Disallow: /forum/index.php?*imode*
Disallow: /forum/index.php?*topicseen*

Ensiferous

how will it handle two threads with the same name in the same forum?
does it 301 redirect old threads to their newer counterpart?
My Latest Blog Post: Debugging Nginx Errors

Dannii

#145
Quote from: arya on March 13, 2007, 11:10:31 AMp.s. : my forums are ported from a ASP portal using SQL export and import directly into smf db. It used lots of relative path for smileys and images which is difficult to change into absolute path.
I'd recommend you do a search and replace on the database to change them all into absolute urls. That shouldn't be too difficult, there have been many topics about it before.

Quote from: stuartbrandon on March 13, 2007, 02:01:15 PMas I think it is not good to have this I wonder how can I block them on robots? My old robots looks like this (se below) but I'm not sure if this works now with the new pretty URL installed. What I need to change?
Try adding this to your robots.txt
Disallow: *sort=*

Quote from: NoFear on March 13, 2007, 02:41:04 PMhow will it handle two threads with the same name in the same forum?
does it 301 redirect old threads to their newer counterpart?
Two topics: yes, one is suffixed with it's topic number
301 redirects: not yet, but I will add that in when I figure out the best way to.

Btw, if you had 0.3 installed, you can uninstall the old packages and then download them straight from the package list. No need to come to SM.org or the Google code site.
"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."

99Paul

Ok, I know this is going to seem like a dumb question, but, how do I install this thing?

Do I make a new folder on my hosting like /forum/packages/prettyurls/ and upload all  the files there, then go through the install process in my SMF admin?

Thanks everyone

Paul

Dannii

You should be able to upload the package directly through the package manager, no need to decompress it yourself.
"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."

99Paul

Quote from: eldʌkaː on March 14, 2007, 03:56:15 AM
You should be able to upload the package directly through the package manager, no need to decompress it yourself.

Thanks kindly. I'll gve it a whirl.

Paul

99Paul

I keep getting  the following error message when trying to download from my admin panel:

"An Error Has Occurred!
The package you are trying to download or install is either corrupt or not compatible with this version of SMF."

Any other way to install it?

Paul

Quote from: 99Paul on March 14, 2007, 03:57:58 AM
Quote from: eldʌkaː on March 14, 2007, 03:56:15 AM
You should be able to upload the package directly through the package manager, no need to decompress it yourself.

Thanks kindly. I'll gve it a whirl.

Paul

Dannii

What version of SMF do you use?
"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."

99Paul

Quote from: eldʌkaː on March 14, 2007, 04:09:54 AM
What version of SMF do you use?

Hi eldʌkaː,

I downloaded the tar to my computer and just uploaded it through the smf admin. Haven't gotte to installing it yet, but I will try in a few minutes.

I'm using smf 1.1.2

I'll let you know my progress

Paul

99Paul

#152
Thanks for being so helpful and patient with me eldʌkaː

I've installed the base package successfully with no errors in the package manager. I then went and put the proper code in my .htaccess file and also uncommented and changed the last line to /go/ instead of /forum/

I then installed the second part of the package and everything went fine there too.

It 'appears' to be working correctly, like when I hover my mouse over a forum title, I see the following hxxp:www.xxxx.com/go/show-off-your-stuff/0/ [nonactive] but when I click it gives me a 404 error.

Am I missing something obvious?

Oh, I have the Orange lt theme installed and one other mod that puts an RSS feed icon and link next to each individual forum.

Also, here's a copy of the contents of my .htaccess file in case something may be conflicting:

Options +FollowSymLinks
<Files ".ht*">
order allow,deny
deny from all
</Files>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^xxxx\.com
RewriteRule ^(.*)$ hxxp:www.xxxx.com/$1 [nonactive] [R=301,L]

#   Example .htaccess file for the SMF Pretty Urls mod
#   If you already have a .htaccess file you will have to manually edit this and that file together. If not, you should be able rename this file to .htaccess and have it work without any changes. The default options should work, but other possible options are also provided commented out (for example, if you want to change the base location to /forum/)

#   Pretty board urls

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]

#   Pretty topic urls

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]

#   To change the base url, just add the child folder name to the front of the pattern.

RewriteRule ^/go/([-_!~*'()a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]




Paul

Dannii

Did you change the base url setting to reflect that?
You should also recomment the last line (it's just an example) and add go/ to the beginning of the other lines.
"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."

99Paul

 just made the changes you suggested above and still no luck. Still 404 errors.

I also discovered something else. When hovering over urls for new messages on the right, they look like this:

hxxp:www.xxxx.com/go/show-off-your-stuff/example-of-how-and-what-to-post-in-this-forum/msg7/#new [nonactive]

hxxp:www.xxxx.com/go/videos-and-podcasting/freeiq-com-a-new-video-business-medium/msg7/#new [nonactive]

hxxp:www.xxxx.com/go/rules-and-announcements/our-mission/msg7/#new [nonactive]

They ALL have /msg7/ at the end.

Paul

Dannii

Can you post up the .htaccess file again, try putting it in [code] tags too ;)
As to the msg7, that's the way it is in SMF normally. It uses the last message number + 1 to ensure you go to the end of the topic.
"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."

99Paul

Quote from: eldʌkaː on March 14, 2007, 05:36:22 AM
Can you post up the .htaccess file again, try putting it in [code] tags too ;)
As to the msg7, that's the way it is in SMF normally. It uses the last message number + 1 to ensure you go to the end of the topic.

Ok, here's the last .htaccess code I have:


Options +FollowSymLinks
<Files ".ht*">
order allow,deny
deny from all
</Files>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^xxxx\.com
RewriteRule ^(.*)$ http://www.xxxx.com/$1 [R=301,L]

# Example .htaccess file for the SMF Pretty Urls mod
# If you already have a .htaccess file you will have to manually edit this and that file together. If not, you should be able rename this file to .htaccess and have it work without any changes. The default options should work, but other possible options are also provided commented out (for example, if you want to change the base location to /forum/)

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

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

# To change the base url, just add the child folder name to the front of the pattern. Example:
#RewriteRule ^/go/([-_!~*'()a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]


Still the same problems.

I was reading page 9 of this thread and was thinking of reinstalling to see if that would help. Maybe my mistake with putting the /go/ in the wrong place did something to the database?

Paul

Dannii

Is your forum's index.php actually located in the /go/ folder?
"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."

99Paul

Quote from: eldʌkaː on March 14, 2007, 06:21:28 AM
Is your forum's index.php actually located in the /go/ folder?

Yes, it's at /go/index.php

Paul

99Paul

#159
I got it working!!

At first, I included the example.htaccess code in the root .htaccess file at /public_html/.htaccess and tried to use /go/ at the beginning of each line. That didn't work.

So I did this:

I placed that code in /public_html/go/.htaccess and took the /go/ off the beginning of each line.

Now pretty URLs are working perfectly.

I know, it was probably a dumb mistake on my part, but just in case someone else has the same problem I did, at least you now know that the mod will work if the .htaccess is in the same folder as your forum.

BTW, thanks again for all your help and patience eldʌkaː. I hope I didn't put you to too much trouble.

:-[

Paul

Advertisement: