| | |
vBulletin mod_rewrite
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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
http://www.vbulletin.org/forum/showthread.php?t=66569
•
•
Join Date: Aug 2004
Posts: 2
Reputation:
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
Any other idea?
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.
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:
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:
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]
RewriteRule ^belief-spirituality.html$ forumdisplay.php?f=12 [L]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:
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.
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.
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 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?
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.
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.
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.
Last edited by I, Brian; Aug 27th, 2004 at 12:21 pm. Reason: more blessings :)
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.
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.
Thanks for the tips - it's always just the daft little things that floor me. Apologies if I made you look too hard.
![]() |
Similar Threads
- [Revised] vBulletin Mod_rewrite Tutorial (PHP)
- vBulletin mod_rewrite for vB 3.0.7 (Existing Scripts)
- vBulletin mod_rewrite for vB 3.0.7 (Growing an Online Community)
- vBulletin mod_rewrite in phpBB mod format (Existing Scripts)
Other Threads in the PHP Forum
- Previous Thread: Help Needed
- Next Thread: mysql_num_rows warning
| Thread Tools | Search this Thread |
apache api array beginner beneath binary broadband broken button cakephp checkbox class cms code countingeverycharactersfromastring crack cron curl database date display dynamic echo email error fcc file files folder form forms freelancing function functions google href htaccess html image include incode insert integration ip javascript joomla limit link login mail match menu method mlm mod_rewrite multiple mysql oop pageing pagerank paypal pdf php problem query radio random recursion recursiveloop remote script search server sessions sms smtp soap source space sql strip_tags subversion support! survey syntax system table template tutorial undefined update upload url validator variable video virus web window.onbeforeunload=closeme; youtube






