View Full Version : how about making the URLs search-engine friendly?
ManoOne
Thu 30th May '02, 2:42am
How about making the URLs indexable by google and such?
It IS possible, there are several tricks discussed about in several php forums on the net (devshed, etc.)
for example:
http://www.site.com/showthread.php?&threadid=18413
Could be written like this:
http://www.site.com/showthread/18413
... with 2 little tweaks:
1. remove showthread's extension + add a line to a .htaccess file to process showthread as a php file:
<Files showthread>
ForceType application/x-httpd-php3
</Files>
2. add some code to the showthread file:
$url_array=explode("/",$REQUEST_URI);
$threadid=$url_array[2];
... and this also works with extremely long urls like:
http://www.site.com/foo.php?action=getrestaurants&city=losangeles&max=5000
.... yes that can become:
http://www.site.com/foo/getrestaurants/losangeles/5000
I am not a super expert, but the experts should consider my suggestion... People with huge forums would benefit from being indexed...
example site: http://www.gotocity.com/ (not by me, but works that way)
These tips were proven to work, not by me :) but many are reporting miracles from doing this... Read this article: http://www.phpbuilder.com/columns/tim20000526.php3
there are many other articles.
I would LOVE to see vbulletin become better at being indexed by search engines! :) I am working on applying those techniques on my own scripts and sites.
Anime-loo
Thu 30th May '02, 3:04am
there are hacks at vB.org that will do this, i run one right now that archives and allows you to submit that to google, anthor will use mod re-write to make the urls look like this
www.yoursite.com/forum/f1/t1
ill be installing that one soon, to see my archive click below
http://www.kousetsu.net/forums/archive/index.php
ManoOne
Thu 30th May '02, 1:14pm
interesting!
how would you use mod re-write to do this? I saw it mentionned on several articles about this topic but nobody actually exaplined the steps.
I am tired of seeing my HUGE music community site not being seen by search engines at all! Especially since I re-did the whole site in php+mySQL (not just the forum).
Thanks for your participation int he thread :)
The Prohacker
Thu 30th May '02, 8:19pm
Originally posted by ManoOne
interesting!
how would you use mod re-write to do this? I saw it mentionned on several articles about this topic but nobody actually exaplined the steps.
I am tired of seeing my HUGE music community site not being seen by search engines at all! Especially since I re-did the whole site in php+mySQL (not just the forum).
Thanks for your participation int he thread :)
RewriteEngine on
RewriteRule ^/f([0-9]+)/s([^/]+?)$ /forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^/t([0-9]+)/s([^/]+?)\.html$ /showthread.php?threadid=$1&s=$2 [L]
RewriteRule ^/s([^/])+?/$ /index.php?s=$1 [L]
More info about this hack:
http://www.vbulletin.org/forum/showthread.php?s=&threadid=18035&highlight=Search+friendly
ManoOne
Thu 30th May '02, 11:31pm
excellent! thanks
Thomas P
Fri 31st May '02, 7:58pm
For our board this would be extremely helpful, since we have some nice tips online, but they don't show up in search engines - only the homepage...
-Tom
okrogius
Fri 31st May '02, 10:13pm
Actually mod_rewrite woudln't be needed. Just use an array split by / from $PATH_INFO.
The Prohacker
Sat 1st Jun '02, 12:09am
Originally posted by Codename49
Actually mod_rewrite woudln't be needed. Just use an array split by / from $PATH_INFO.
Most people don't want to edit their files, and therefore void them from priority support :D
mod_rewrite won't do that :D
ManoOne
Sat 1st Jun '02, 3:57am
DONE!
http://www.futureproducers.com
not just the forums, but also the whole site (and thats thousands of pages)
all use one script which splits the url (as mentionned above)
its pretty flexible in the way I did it, it just needs /name/value/name/value/name/value
so I can put /threadid/xxxxxx/s/xxxxxxxxxxxxxxxxxxx OR /s/xxxxxxxxxxxx/threadid/xxxxxx
doesnt matter!
works like a charm! I am so happy!
I removed the .php extension on showthread, forumdisplay and index, and used .htaccess to process those as php
:D yayyyy
example: http://www.futureproducers.com/forums/showthread/s/a938a872d093ab186f67cfd7bcb17866/threadid/18436
aaahhh :)
yes i could have removed the variable names, but as I said before, I enjoy the flexibility of ordering variables as I want (so that i dont HAVE to have threadid after the first "/", etc.
me happy
Thomas P
Sat 1st Jun '02, 5:16am
Hi,
could you please enlighten us, how did you do that?
Regarding the '/': Keep in mind that slashes are interpreted as (sub)directories - the deeper something seems to be for a search engine, the more irrevelant for a search afaik.
Thanks,
-Tom
P.S.: Thanks bigtime to the ProHacker, who took the time to find out that my mod_rewrite is messed up.
ManoOne
Sat 1st Jun '02, 1:55pm
It is more relevant than not being seen by search engines at all ;)
I am looking into getting rid of the s variable, because thats a HUGE string... Not sure if that variable is important, will post a thread question.
I was able to just add an include(''); line to my global.php file and VOILA (versus writing an array exploder that "looks for this or that variable".
the script takes the url string and creates an array with the variable names and their values (looks for first string after /, makes that the value name, takes the next string and assigns as the value, etc.)
... it works
Wayne Luke
Sat 1st Jun '02, 4:13pm
Originally posted by The Prohacker
Most people don't want to edit their files, and therefore void them from priority support :D
mod_rewrite won't do that :D
Since this is the suggestion forum and might be put into the core of vBulletin, then how would they have to modify their files?
Mod_rewrite is just as unworkable in a cross platform product since it only works in Apache.
okrogius
Sat 1st Jun '02, 5:26pm
Originally posted by wluke
Since this is the suggestion forum and might be put into the core of vBulletin, then how would they have to modify their files?
Mod_rewrite is just as unworkable in a cross platform product since it only works in Apache.
While making an array from $PATH_INFO works quite well on plenty of platforms.
Thomas P
Sat 1st Jun '02, 6:53pm
Well if there's a way to get "friendlier" URLs via scripting then I'd appreciate that
Scott MacVicar
Sat 1st Jun '02, 7:42pm
Changing the seperator for passed in url's, its the & in urls which isn't spidered.
So
blah.php?action=moo&test=2
wont work but
blah.php?action=moo;test=2
will work.
James Cridland
Sun 2nd Jun '02, 3:40pm
I don't want to mess with mod_rewrite, and, in fact, can't... it's not my server.
What I *can* mess with is my own 404 error. Most ISPs will let you re-point your own 404 page somewhere... like http://www.mediauk.com/error
Now, since you can tell what people have actually typed into their browser to bring up this error, you can use it to redirect to a page you want with a little fancy bit of PHP.
Not sure this would make the search engines do the trick... it probably won't.
ManoOne
Mon 3rd Jun '02, 5:25pm
The way I did it works fine, really
It is just a bit of a pain to edit all the links in the templates, such as the page navigation (page numbers) and such... So that the spiders "follow" the links.
Its nice though. Just a .htaccess file and 1 include("") line in the global.php to the script that looks for variables in the url path... voila!
John
Mon 3rd Jun '02, 5:35pm
Just to let you know, we've worked a bit of magic on vB3, and we've included a search engine friendly system that does not rely on mod_rewrite. It does unfortunately require Apache.
But you can find out more when we open up the beta site ;)
John
filburt1
Mon 3rd Jun '02, 5:40pm
Originally posted by John
Just to let you know, we've worked a bit of magic on vB3, and we've included a search engine friendly system that does not rely on mod_rewrite. It does unfortunately require Apache.
My my my, what a shame ;)
Joe
Mon 3rd Jun '02, 5:40pm
/me hugs John... THANK YOU! :D
James Cridland
Mon 3rd Jun '02, 5:40pm
Looks good... :)
boatdesign
Wed 5th Jun '02, 5:15am
Just to let you know, we've worked a bit of magic on vB3, and we've included a search engine friendly system
Excellent!
Thomas P
Wed 5th Jun '02, 9:03am
Originally posted by John
Just to let you know, we've worked a bit of magic on vB3, and we've included a search engine friendly system that does not rely on mod_rewrite. It does unfortunately require Apache.
But you can find out more when we open up the beta site ;)
John
You made my day :)
Thanks, great news,
-Tom
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.