vBulletin

Thank you for visiting. This is our website archive. Please visit our main website by clicking the banner above.
vBulletin FAQ is dedicated to helping the forum owner build, manage and profit from his vBulletin Forum
vBulletin Web Hosting - Free skins and styles for your vBulletin - Search Engine Optimization




Mod Rewrite Vbulletin

anthony parsons
04-27-2005, 05:59 PM
Daniweb (http://www.daniweb.com/techtalkforums/thread9379.html) supplies a great mod_rewrite for vbulletin, apart from it doesn't work in 3.0.7, so here is the correct version that does. If you have a previous version of vbulletin, I would suggest going to Daniweb (http://www.daniweb.com/techtalkforums/thread9379.html) and using the version posted their.

Step 1

Admin CP > Styles & Templates > Search in Templates > Find & Replace in Templates

Place the following code into the box "Search for Text"

<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">

Place the following code into the box "Replace with Text"

<a href="forum$forum[forumid].html">

Change check box "Test Replacement Only" from Yes to No.

Click "Find"

The following templates will be changed:

forumhome_forumbit_level1_nopost
forumhome_forumbit_level1_post
forumhome_forumbit_level2_nopost
forumhome_forumbit_level2_post
forumhome_subforumbit_nopost
forumhome_subforumbit_post

Step 2

Admin CP > Style Manager > Edit Templates > forumhome_lastpostby

Find:

<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$lastpostinfo[lastthreadid]" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>

Replace With:

<a href="newpostinthread$lastpostinfo[lastthreadid].html" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>

Find:

<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>

Replace With:

<a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>

Find:

<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>

Replace With:

<a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>

Step 3

Admin CP > Style Manager > Edit Templates > threadbit

Find:

<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$thread[threadid]">

Replace With:

<a href="lastpostinthread$thread[threadid].html">

Find:

<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]">

Replace With:

<a href="newpostinthread$thread[threadid].html">

Find:

<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">

Replace With:

<a href="thread$thread[threadid].html">

Find:

<a href="showthread.php?$session[sessionurl]t=$thread[threadid]&amp;goto=lastpost$thread[highlight]">

Replace With:

<a href="lastpostinthread$thread[threadid].html">

Step 4

Create a .htaccess file with the following, and upload to the root forum folder, ie. where the forumdisplay.php and showthread.php files are.

RewriteEngine on
Options +FollowSymLinks
RewriteRule ^thread([0-9]+).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
RewriteRule ^forum([0-9]+).html$ forumdisplay.php?f=$1 [L]

Step 5

Admin CP > Style Manager > Edit Templates > navbar

Find Twice:

<a href="$vboptions[forumhome].php?$session[sessionurl]" accesskey="1">

Replace Both Instances With:

<a href="./" accesskey="1">

Step 6

Edit forumdisplay.php & showthread.php in your forum root path.

forumdisplay.php, find:

// draw nav bar

showthread.php, find:

// draw navbar

A few lines below those above, in each file, you will find a loop that looks like:

foreach ($parentlist AS $forumID)

{

$forumTitle = .....

$navbits[.....

}

Replace Both Files With:

foreach ($parentlist AS $forumID)

{

$forumTitle = $forumcache["$forumID"]['title'];

$navbits["forum$forumID.html"] = $forumTitle; // edited by dani

}


Step 7

Admin CP > Style Manager > Edit Templates > showthread_similarthreadbit

Find:

<a href="showthread.php?$session[sessionurl]t=$simthread[threadid]" title="$simthread[preview]">$simthread[title]</a>

Replace With:
<a href="thread$simthread[threadid].html" title="$simthread[preview]">$simthread[title]</a>


That's It Folks!

Now just wait for all the search engines to spider your now friendly URL's.

A possible suggestion running static URL's, is to turn off your archive so you don't have two lots of static URL's being indexed. Don't **** search engines off.

anthony parsons
04-27-2005, 06:11 PM
The question was asked off me, why do you want this? Simple, it takes away the dynamic URL parameters and query strings and replaces them with static, which means all search engines can then read your content, not just those that are advanced enough to read multiple queries, ie. ? = & etc etc.

Contrary to some old beliefs in the SEO world, this will not work as good as the archive mod that comes with VB or the hack you can implement for earlier versions, but it presents the basic forum in a more productive form. The archive hack takes out all the forum garbage and presents the content in its rawest form, being; forum content that doesn't look like a forum.

The reason why I say, turn the archive hack off if using mod_rewrite, is that you really don't want to deliver two forms of the same content to the search engines. No you won't get filtered as duplicate content, because the spiderable content looks very different from the forum page compared to the equivalent archive page, though its not real hard, if already done, for a search engine to simply include a vb module within its algorithm to disregard the forum, or archive version if activated, from its results. Its actually quite simple really.

If you want to further optimize your board, take up other advice here, and basically, make your forum look less like a forum to the search engines. What does that mean? Delink usernames from posts, delink all the rubbish you can click on within a forum. Its handy for general forum usage, though you will see improved results by turning off as many of the links as possible that are not required by search engines. Things like the display mode and rate thread can be turned off, as a user can change their display through the user cp. You get the idea. Hope the above helps you though.

Don't forget, this isn't my invention, it is Daniwebs, I just fixed it to work in vb 3.0.7, that's all.

bigike
05-01-2005, 12:57 PM
Thanks very much man. I had been wanting to implement mod_rewrite on my forums but hadn't because it wasn't compliant with 3.7. Thanks again

anthony parsons
05-01-2005, 11:11 PM
No probs mate, glad its off help.

wirewolf
05-02-2005, 11:47 AM
anthony, implemented your code on my forum (http://shipmodeling.net/vb_forum/), and it worked fine, no problems. Thank You.
I do have one question. In my original htaccess file (the one you mention to edit above), it had one line in it already (I've never edited this file before) - It was "Options All". I removed this line and replaced it with the text for the rewrite. Should this line have stayed in? Everything seems to be working ok, so I assume it can be left out, but I just wanted to check.

I tried this edit for "showthread_similarthreadbit":
Find:<a href="showthread.php?$session[sessionurl]t=$simthread[threadid]" title="$simthread[preview]">$simthread[title]</a>
Replace with:<a href="thread$simthread[threadid].html" title="$simthread[preview]">$simthread[title]</a>Works fine!!

John

anthony parsons
05-02-2005, 07:04 PM
Does your similiar threads connect to the correct URL now? Being the static one! If so, then it is ok, if not, I would put it back the way it was.

wirewolf
05-02-2005, 07:12 PM
Yes, they do. Works fine. Go to the bottom of this page (http://shipmodeling.net/vb_forum/thread632.html) and click some of the similar links.
BTW, what about my "Options All" question above?
Thanks, John

anthony parsons
05-02-2005, 08:10 PM
Oh, sorry. It shouldn't matter, though you physically not editing .htaccess means nothing, as your server writes to this file when you change certain parameters upon it. So you could put it back in, and it won't hurt, as I don't know what you have done on your server in the past, as to why it would have put it there. I would put it back for safety, though if it messes with the vb mod rewrite, just remove it again. Any 301 redirects, etc etc, will write to your .htaccess if you implement them through your server and so forth. I don't have that problem I guess, as I manually do all my files.

wirewolf
05-02-2005, 08:25 PM
I'll put it back and see what happens.
Oh. I added this to the urls in a hack I have for showing Most Recent Posts in FORUMHOME: "lastpostinthread$thread[threadid].html", instead of "showthread.php?$session[sessionurl]goto=lastpost&amp;t=$thread[threadid]"
Works!!! Check it out - Forumhome (http://www.shipmodeling.net/vb_forum/), right at the top of the page - " Most Recent Posts:"

John

anthony parsons
05-02-2005, 08:39 PM
Yep, just had a further look at the below info, and I recommend you implement it if your utilising the "similar thread" content displayed at the bottom. Good find John. This way, your similar threads are going to the static URL's, not the dynamic URL's (which defeats the purpose really).

anthony, implemented your code on my forum (http://shipmodeling.net/vb_forum/), and it worked fine, no problems. Thank You.
I do have one question. In my original htaccess file (the one you mention to edit above), it had one line in it already (I've never edited this file before) - It was "Options All". I removed this line and replaced it with the text for the rewrite. Should this line have stayed in? Everything seems to be working ok, so I assume it can be left out, but I just wanted to check.

I tried this edit for "showthread_similarthreadbit":
Find:<a href="showthread.php?$session[sessionurl]t=$simthread[threadid]" title="$simthread[preview]">$simthread[title]</a>
Replace with:<a href="thread$simthread[threadid].html" title="$simthread[preview]">$simthread[title]</a>Works fine!!

John

wirewolf
05-02-2005, 08:47 PM
Already did and it works fine. I'm going to play around with my CMPS portal page too for "Latest Forum Topics", convert the php urls to the html. Don't see why it wouldn't work. I'll give it a shot and see what happens. I'll let you know.
John

anthony parsons
05-02-2005, 08:50 PM
Yer, some good 'nice to knows' for people using those hacks with their 3.0.7. If people are using them, then I would highly suggest taking up a further looksie through them to ensure your not undoing all your good work, by linking to .php pages instead of .html.

wirewolf
05-02-2005, 11:13 PM
anthony, I applied the rewrite changes to vBadvanced CMPS and it works like a charm. It involved three vBadvanced CMPS template edits, one vBadvanced CMPS phrase edit, and one edit to the news.php module.

See this page (http://shipmodeling.net/cmps_index.php?). Check out the News Threads in the center column and the "Latest Forum Topics", right hand side. All the urls are html.

I have my edit file of all the changes, but I hesitate to post it here in the open, as vBadvanced may not like it. Can I PM them to you?

John

anthony parsons
05-02-2005, 11:17 PM
Excellent. Yes mate, PM away.

wirewolf
05-02-2005, 11:37 PM
on the way
John

contactsonia
05-03-2005, 03:12 AM
Does this work with vB 3.0.6?
I would like to try this one.

anthony parsons
05-03-2005, 06:07 AM
Don't know, haven't tried it. Give it a go and tell us all, otherwise, you can use the original at http://www.daniweb.com/techtalkforums/thread9379.html, the creator, which may suit lower versions. There is only a couple of mods to it all so it worked properly in 3.0.7. Tell us how you go.

contactsonia
05-04-2005, 02:15 AM
This mod worked fine on vBulletin 3.0.6 also.
I also tried http://www.daniweb.com/techtalkforums/threadnav9379-1-15.html and it also worked fine so I have implemented Danweb's mod as it provide some extra features ;)

anthony parsons
05-04-2005, 03:38 AM
Here are some other related mod_rewrites from Daniweb:

A revised version: http://www.daniweb.com/techtalkforums/threadnav12725-1-15.html

The new VB 3.0.7 version: http://www.daniweb.com/tutorials/tutorial22840.html

If your on 3.0.7, I would personally wipe the one above and install the new one from Daniweb. Lots of new and improved functions.

PhotoDiscussions
05-23-2005, 12:03 PM
I applied this to my forums, and now when i try to merge a thread, in Internet Explorer only it seem, it tells me the url for merging the threads doesn't exist. is this a possible bug, or did i do a edit wrong?

Noppid
05-23-2005, 01:34 PM
This hack will be interesting when we see the new 3.5 code.

If you didn't already have this, it could be a bad time to add it.

contactsonia
05-23-2005, 08:11 PM
This is because you are inputting SE friendly url in the input box. You will need to put the url in original format i.e. http://www.your-forum/showthread.phpt=threadid

.

anthony parsons
05-24-2005, 01:01 AM
If you installed the one from Daniweb, then you have done something wrong, as I run two forums with that mod_rewrite, and both a perfect, even merging threads.

Joeychgo
06-08-2005, 11:50 AM
Comments like this make me thing modrewrite is unecssary for vbulletin.

This was made by googleguy on WebMaster World
http://www.webmasterworld.com/forum30/29720.htm


I've been aching for a long time to mention somewhere official that sites shouldn't use "&id=" as a parameter if they want maximal Googlebot crawlage, for example. So many sites use "&id=" with session IDs that Googlebot usually avoids urls with that parameter.

vBulletin doesnt use this parameter.

But it is an argument against other kinds of software such as PHPBB.


FYI - Googleguy is a Google Engineer, so you can take his words and being credible opinions.

Noppid
06-08-2005, 12:26 PM
I have asked every user that takes the time doing this hack to show me how it's better then the stock vB with a few tweaks that are not an issue at upgrades. That alone made this hack a no go for me.

I have yet to get any data that it makes the software get indexed more or better.

I'm all for the benefits of a well done mod rewrite, but not at this level of management expense. If it came down to vB had to have it, I'd probably consider another software before I hacked vB to hell and back.

But that's just me. :o

Joeychgo
06-08-2005, 12:35 PM
I have asked every user that takes the time doing this hack to show me how it's better then the stock vB with a few tweaks that are not an issue at upgrades. That alone made this hack a no go for me.

I have yet to get any data that it makes the software get indexed more or better.

I'm all for the benefits of a well done mod rewrite, but not at this level of management expense. If it came down to vB had to have it, I'd probably consider another software before I hacked vB to hell and back.

But that's just me. :o


Unfortunately, I think all the forum software available have this issue so some extent. PHPbb is one that uses those session ids. This is why when I bought a PHPbb forum I converted it to vb immediately. vBulletin is SE friendly, with or without the mod rewrite.

I have also asked for someone to show me some hard evidence that the MOD Rewrite works. Nobody has so far provided me with any such data either.

PhotoDiscussions
06-08-2005, 02:46 PM
Well i don't think its helped my site much if any at all, so i'm still waiting to see...

anthony parsons
06-08-2005, 07:19 PM
I implemented my mod_rewrite into VB a month or so ago, and the entire forum is now indexed and ranking well. The traffic to my forum is now substantial again. Mod_rewrite is only about delivering a readable URL to the SE's, nothing more. It has nothing to do with your page content.

Noppid
06-08-2005, 08:05 PM
I implemented my mod_rewrite into VB a month or so ago, and the entire forum is now indexed and ranking well. The traffic to my forum is now substantial again. Mod_rewrite is only about delivering a readable URL to the SE's, nothing more. It has nothing to do with your page content.


But that's the thing, I've never seen a vb php url to be an issue as far as crawling since the session url is handled by the software for bots.

I do like the idea of consolidating all the multiple different urls that point to the same place though. It's just too many edits.

Then the announcement of 3.5 and I figured no way could I chance it.

anthony parsons
06-08-2005, 11:39 PM
Yes, but most people only ever consider G, Y and MSN. Some of the other players don't handle any parameters well, so its best just to play friendly to everyone IMO.

Raider
08-27-2005, 03:15 PM
Am I doing something wrong?

http://www.etqw.com - i still see showthread etc..

Joeychgo
08-27-2005, 03:41 PM
you must have - the mod rewrite isnt working

Raider
08-27-2005, 04:05 PM
Can you tell what I did wrong?

Joeychgo
08-27-2005, 04:13 PM
Not sure - dont know what you did.

Raider
08-27-2005, 04:15 PM
I followed everything in the steps though.

Joeychgo
08-27-2005, 04:22 PM
apparantly you missed something. I havent installed this hack because I think its unecessary - so I cant tell you exactly.

Go back and check each step

drixt
05-16-2008, 03:53 PM
let me do it , i was trying to get something likw ur post .. thank u !


vBulletin

seo book

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum