Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite help on a migrated phpbb forum, pls. help

         

seminole

9:38 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



I have a couple of medium sized forum communities with phpbb that I started long ago, before I knew what I was doing. I am just migrating to new servers for speed and bandwidth.

I also needed to change the forums folder to a more keyword intelligent name. So the forums were at:

http:// mydomain.com/forum/XXXCONTENT

I have renamed folder, got all content moved and system working, migrated data and content to:

http:// www.mydomain.com/keyword-forum/XXXCONTENT

Also, i want to force more use of www in my url as I do this. Can someone assist in some code for the mod rewrite to accomplish this task. It would be greatly appreciated. I dabbled and sent my server spinning out somehow. Honestly, I decided not to do this without some assistance on the code.

I know how to use mod rewrite in .htaccess but not very good with the code. Am willing to send a few paypal $ by email for quick help with this thing, my board is losing traffic with all these URLs being misrouted and stuff right now, so it's a pretty urgent problem for me. TIA.

eelixduppy

9:48 pm on Jun 2, 2006 (gmt 0)



Here's a thread on Beginning ModRewrite [webmasterworld.com], taken from the Apache Forum Library [webmasterworld.com]. Also, look at this thread on Regular Expressions [webmasterworld.com]; it will help you some more. Good luck!

seminole

12:11 am on Jun 3, 2006 (gmt 0)

10+ Year Member



OK, Here's what I came up with. I found a really good page chock full of actual examples. There was a paragraph for each with a real world purpose and example. I was able to see what to replace and modify pretty easy, tried it, and viola! Thought I would share it for the next guy.

Options +FollowSymlinks
RewriteEngine on
############################################################################
## THIS RULE KILLS ALL WWW USED AND SHORTENS THE URLS, DOES A 301 REDIRECT
############################################################################
rewritecond %{http_host} ^www\.example\.com [nc]
rewriterule ^(.*)$ http://example.com/$1 [r=301,nc]
############################################################################
## THIS RULE DOES A 301 REDIRECT FROM AN OLD FOLDER TO A NEW FLDR, MY PHP-BB
############################################################################
rewritecond %{http_host} ^db_user_forums [nc]
rewriterule ^(.*)$ graphic-design-prepress/$1 [r=301,nc]

[edited by: jatar_k at 12:14 am (utc) on June 3, 2006]
[edit reason] examplified [/edit]