PDA

View Full Version : Mod_rewrite tutorial for vB3


cscgal
08-14-2004, 10:00 PM
I've written a detailed tutorial for vBulletin 3 how to go about using mod_rewrite to allow your forum to have clean URLs. It goes so far as to give forum URLs names such as forum-name.html instead of forum-IDnumber.html

It's available here: http://www.daniweb.com/techtalkforums/thread9379.html

I hope that you enjoy it!

Dean C
08-15-2004, 09:14 AM
Hi dani,

Please could you post the tutorial here, so in the event your site goes down our users aren't left stranded. Thankyou

cscgal
08-15-2004, 10:04 AM
At this time, I would rather not spread my tutorial around to other sites. As I just wrote it late last night, I am still getting a lot of feedback about it, and therefore I keep making updates and revisions to the tutorial. (There have actually been 3 changes in the past 2 hours!) For that reason, I would rather keep it all in one place. In addition, I might as well just come out and say that the only reason I decided to share my technique (via the tutorial) was to hopefully draw some attention to my web development and SEO forums.

hpwilhelm
08-22-2004, 09:23 AM
Thanks cscgal! Just what I was looking for! :)

Registered at your site also, looks like a good place to be...

Dean C
08-22-2004, 09:33 AM
There's really no need to rewrite the URL's in your vBulletin. The spiders have no problems interpreting the default query string. Also they have no problems spidering the archive :)

cscgal
08-22-2004, 01:10 PM
Thanks hpwilhem. Dean C, I've actually seen this argument sooo many times ;) But, hey, I think it really helps a lot, and so does my SEO guy :) so that's all that matters :)

cscgal
04-30-2005, 04:53 AM
Hey there fellas. I just want to give you an update on the DaniWeb mod_rewrite hack - I've updated it to what DaniWeb is currently using, in a whole new tutorial. There is support for multiple pages, Who's Online (no more Unknown locations!), previous / next threads, linear / hybrid / threaded modes, and much more! Enjoy :)

http://www.daniweb.com/tutorials/tutorial22840.html

sv1cec
05-11-2005, 11:15 AM
Can someone shed some light for me, as far as what this hack actually does? I checked Daniweb and I can find no such description.

Thanks

cscgal
05-11-2005, 12:28 PM
It rewrites the forum URLs so that they are cleaner. For example:

http://www.daniweb.com/techtalkforums/showthread.php?t=123

is now written as

http://www.daniweb.com/techtalkforums/thread123.html

The advantage of this is much better spiderability by search engines, since it fools the search engines into thinking you have static HTML pages instead of dynamic PHP pages with query strings.

sv1cec
05-11-2005, 02:18 PM
Thank you for your quick response.

Rgds

ice9
05-11-2005, 05:34 PM
Dean C -- my experience is not similar to yours, but if you're successful in getting your content indexed without having to hack the urls, that's a huge bonus -- this hack is a major PITA!

cscgal -- I appreciate the work you've put into this. I SEO'd vb2 years ago, and it made a HUGE difference in traffic to my site. I've recently upgraded to vb3, and I'm putting some serious effort into properly rewriting the urls again.

I remember a while back Overgrow.com was one of the first sites I knew of to put work into SEO for vb. Overgrow opted for the archive system, which, IMO, is inferior to cleanly re-written urls. Overgrow pointed me to dbforums.com, they were one of the first sites to successfully use static urls with vb.

I'm working on inserting the thread title into the url. Also, I think duplicate pages are a bad move. A crawler should only receive one version of a page. Scripts like printthread.php and showpost.php present the same content to a bot as showthread.php. This sets you up for a duplicate content penalty. Same thing with cramming variables into hyphenated urls, like this: site.com/forum/t12345-15---2-asc--3.html and site.com/forum/t12345-10-2-10-desc--.html are sloppy, and are often duplicates. Maybe dupes like that should be excluded via robots.txt? I like threads that appear to be in the main directory -- better SEO. I think the ideal url would look like this:

site.com/t(threadid)-(hyphenated thread title)(-pagenumber).html

For example:

site.com/t12345-SEO-vbulletin-2.html

I'm not sure what to do with the perpage variable. I don't really think it's that necessary, and it makes for duplicate urls.

Besides, I think that other showthread/forumdisplay variables can be added on AFTER the .html suffix, like this:

site.com/t12345-SEO-vbulletin-3.html&order=asc&highlight=word&perpage=25

Then, robots.txt could be used to exclude a crawler from any url that has variables after the .html suffix. So, no dupes.

Either way, if a variable is empty, its hyphen shouldn't be in the url. This looks bad:

site.com/t12345----10---asc-.html

Also, watch for the "." character in your .htaccess file. It's a regex wildcard, and will need to be backslash-escaped if it is to represent a period, as in \.html.

Most SEO vb hacks don't allow for styleid adjustments via the dropdown menu.

Some sites use a default style for re-written urls for non-registered members, and then feed another style to registered members. So the bots get the rewritten urls, and members get the real ones. I disagree with this -- better rankings are accorded to urls that are used, and linked to on other sites. When members are on other sites, and they link to your threads, it should be with properly rewritten urls.

mod_rewrite has a logging function that can be very useful, although it's rather verbose, even at the lower settings.

Hope this helps -- sorry for the long post. This is an extremely complex hack that most sites are not using to its full potential.

vktechnology
06-04-2005, 11:25 PM
very cool,
URL friendly, human readable,
it is good for user to remeber URL
It look like static page

cristi71000
06-20-2005, 09:48 AM
Hi,

Is this optimisation working for vBulletin forums hosted on IIS? And if not are there any alternatives?

Thanks,
Cristian
phoneheaven.org

deathemperor
06-20-2005, 04:44 PM
I think this is unnecessary since vb offers HTML package too for your site.