954,136 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

I tried this and joined here after your post at seoforums. I need your help. There were a few changes from your vb 3.0.1 to vb 3.0.3.

I put the changs in that you states through your steps. First off thanks for the post and the mod, it is outstanding. I was wondering if you could help me! Is there anyway that you would be willing to look at my test forums and tell me what is wrong with what I did

Mike

http://www.sportsrant.com/testforums


this is what my htaccess file looks like!

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 ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]
msimonds
Newbie Poster
13 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

acutally ma'am i was able to get this to work! It works perfectly and this is an awesome modification. The only question that I have is
when you click on this link (example)

http://www.sportsrant.com/forums/newpostinthread3503.html

then it should go to that URL, instead is goes to the regular php post, but it goes to:

http://www.sportsrant.com/forums/showthread.php?p=58619#post58619

Is there anyway to change that also!!


Mike

msimonds
Newbie Poster
13 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

I sent this email to another VB member here to see one problem with this tweak

he only thing that gets me about this is from the forums home page! (EXAMPLE)

This link here: http://www.sportsrant.com/forums/newpostinthread3501.html takes you to the latest thread like it should: http://www.sportsrant.com/forums/showthread.php?p=58579#post58579 and I do not believe this is good for SEO! If you go into that forum, even on your site, and click on http://www.sportsrant.com/forums/thread3501.html which is the same post and actually goes to the thread. Do you understand where I am coming from! Can this be fixed or tweaked to work, there has to be away. It will make it even more SEO!!

msimonds
Newbie Poster
13 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

The current way of doing things is where the links to newpostinthreadXXX.html and lastpostinthreadXXX.html redirect to their showthread.php? counterparts. The following mini-tutorial will fix that:

STEP ONE

Add the following line to your .htaccess file:

RewriteRule ^post([0-9]+).html$ showthread.php?p=$1 [L]

STEP TWO

All of the following changes need to be made to the showthread.php file:

exec_header_redirect("showthread.php?$session[sessionurl_js]p=$getlastpost[postid]$highlightwords#post$getlastpost[postid]");

should be replaced with

exec_header_redirect("post$getlastpost[postid].html#post$getlastpost[postid]");
exec_header_redirect("showthread.php?$session[sessionurl_js]p=$posts[postid]$highlightwords#post$posts[postid]");

should be replaced with

exec_header_redirect("post$posts[postid].html#post$posts[postid]");
exec_header_redirect("showthread.php?$session[sessionurl_js]t=$threadinfo[threadid]&goto=lastpost$highlightwords");

should be replaced with

exec_header_redirect("lastpostinthread$threadinfo[threadid].html");
exec_header_redirect("showthread.php?$session[sessionurl_js]t=$thread[pollid]");

should be replaced with

exec_header_redirect("thread$thread[pollid].html");
$firstunread = 'showthread.php?' . $session['sessionurl'] . 't=' . $threadid . '&goto=newpost';

should be replaced with

$firstunread = 'newpostinthread' . $threadid . '.html';
cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

that latest fix is the perfect fit and everything works as you posted. I REALLY appreciate your dedication and hard work. For people that want to have SEO type forums, You're an angel!!


Mike :mrgreen:

msimonds
Newbie Poster
13 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

Thank you so so much for your kind words. And thank you for your generous donation to DaniWeb, as well!

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

Wow amazing work. I'll surely try this out when I get the chance.

mrsam
Newbie Poster
15 posts since Jun 2004
Reputation Points: 10
Solved Threads: 0
 

Thanks! :)

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

Just got it done on www.sgwebhostingtalk.com , after some editting here and there since it didnt work very smooth for me. But still thanks ALOT dani ! :twisted:

ToOnZ
Newbie Poster
6 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

Excelent modification, congratulations :D

But :( i have a problem >.<

In my online appears Unknown Location for example:

Unknown
/foro/thread26600.html <-----

or

Unknown
/foro/thread9721.html <----

Any idea to how fix this problem?

Darmak
Newbie Poster
2 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

You're very welcome ToOnZ! I hope you got it all straightened out. Darmak, what you're asking seems that it can be accomplished by editing the includes/functions_online.php file. There is actually an existing vB.org hack that might be helpful - please let us know if it worked for you:

http://www.vbulletin.org/forum/showthread.php?t=66569

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

You're very welcome ToOnZ! I hope you got it all straightened out. Darmak, what you're asking seems that it can be accomplished by editing the includes/functions_online.php file. There is actually an existing vB.org hack that might be helpful - please let us know if it worked for you:

http://www.vbulletin.org/forum/showthread.php?t=66569

Thanks but this hack is for .php scripts and not works whit this mod :/

Any other idea?

Darmak
Newbie Poster
2 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

Are you sure? I was under the impression it will work for all files - php and html. In any case, the file that you would need to edit is the includes/functions_online.php file. When I have more time, I'll investigate it further.

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

I've just tried to have a proper go of this on my religion forums - I did try very hard to follow the instructions as entirely and *only* described in the original post - - - but I have a problem I'm afraid I don't understand, and input would be much much appreciated.

The problem is that every single link leads to a 404. I have an index page with no working links.

However, a couple of things don't look as planned and this may help diagnose the problem:

I tried to follow CSGAL's method of using .htaccess to rename all boards on a forum.

Yet whether I include the rewrites for my individual board names - or not - in the .htaccess file, all of my board names are rewritten anyway.

So whether I include:

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] 
   
   <strong>RewriteRule ^belief-spirituality.html$ forumdisplay.php?f=12 [L]</strong>


or not, my boards still have their names rewritten - for example, the above forum is rewritten as:

/community/belief-and-spirituality.html




Another odd thing is that my sub-forums are all showing with the link:

/community/.html

And that's with - or without - the .htaccess file editing.



None of the "newpostinthread2333.html" etc links work either - absolutely every forum link goes to a 404.



Any ideas whatsoever would be greatly appreciated. I'll keep the forum closed down for the time being until I can get this figured out - at least for today. Help. Please?



:eek:

I, Brian
Light Poster
47 posts since Mar 2004
Reputation Points: 10
Solved Threads: 1
 

Board names are rewritten due to Step 1, editing the includes/functions_forumlist.php file - nothing to do with the editing of the .htaccess file.
Your sub-forums showing a bad link looks like you made a typo in the forumhome_subforumbit_nopost or forumhome_subforumbit_post templates. Just revert those two templates and try again - it looks like you have an added '/' symbol somewhere.
As far as why newpostinthread links don't work - that doesn't make sense. By looking at your .htaccess file they should. But let's take care of one problem at a time. And when everything else is fixed, then we'll look at this problem.

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

Thanks for the suggestions - much appreciated.

I just repeated everything again, reverting all templates, then re-editing them carefully, trying not to make typos - but nothing has changed.

Is it possible that there's something about Apache that is unusually configured on the server my forums are running from? I know on another vBulletin I have the static archive feature does not work because PHP is running as CGI. Is it possible that something similar is happening here?

I, Brian
Light Poster
47 posts since Mar 2004
Reputation Points: 10
Solved Threads: 1
 

Here's what to do. Create an .htaccess file and put everything from Step 5 only into it. Upload it to your forum's root directory. Then, manually type into your browser: www.yourdomain.com/forum/forum1.html or whatever your directory structure just happens to me. Then let me know what happened.

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

Ah-ha-ha! Success!

The key was the .htaccess file in the forum root folder! (As opposed to site root folder, if forum not at the root.)

The only possible additional issue is that the forum titles absolutely had to be the forum URLs - so a board named "keyword1 and keyword2" could not be in the .htaccess file as "keyword1-keyword2" - had to be "keyword1-and-keyword2". I wasn't expecting that. But was easily corrected for via .htaccess.

Dani, you are so a star. :)

Ten thousand blessings on you. :)

I, Brian
Light Poster
47 posts since Mar 2004
Reputation Points: 10
Solved Threads: 1
 

I'm really glad you got it working Brian :) Very cool! I just went back and double-checked my original tutorial thinking maybe I left out about how the .htaccess has to go in your forum directory, but nope, it said that all along ;)

Also, the file includes/functions_forumlist.php creates forum URLs by taking the forum title, converting all letters to lowercase, replacing all slash characters with the dash character, and replacing all spaces with the dash character. So a forum called "Me and You" will be translated to "me-and-you" given those rules.

With a bit of tweaking to Step One of the tutorial, you can remove the word "and" from your rewritten URLs ... or basically remove / tweak / edit any combination of letters to be translated into how you want. I could even tweak it so that a forum called "Dani and vBulletin" could be translated to the URL "dani-and-vB" by replacing all instances of vBulletin with vB ... or translated to "dani-vBulletin" by replacing all instances of " and" with the empty/null string. As you can see, this is the same logic that is used to replace a space " " character with a "-" dash character.

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

Thanks for the tips - it's always just the daft little things that floor me. Apologies if I made you look too hard. :)

I, Brian
Light Poster
47 posts since Mar 2004
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You