Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite a whole forum

         

twistedgamer

12:04 am on Oct 21, 2007 (gmt 0)

10+ Year Member



Ok what I want to do is pretty simple.

I want to take a forum thats in the site root and move it to a subdirectory called forums.

The problem is the variables. I have searched high and low and haven't found anything. I can't be the only one who at some point hasn't decided they need to move there forums to another directory and want to do a 301 redirect so search engines pickup on the change? I assume it's probably my keyword choices for searching.

I have found walk throughs for pointing /index.php to /forums/index.php but that strips every thing past the "?" off.

I've found walk throughs for taking /index.php?variables to search engine friendly urls i.e. /variable1/variable2/ and so forth but thats not what I want.

I simply need to take and existing url

www.somedomain.com/index.php?act=announce&f=8&id=7

to

www.somedomain.com/forums/index.php?act=announce&f=8&id=7

with the variables intact. Not Adding any, not removing any.

If anyone could please point me to a walk through that shows this or give me some idea of where to look and don't bother with the RTFM comments I have and haven't been able to figure it out. I just need the syntax or example of a mod_rewrite directive that keeps the variables in a url.

jdMorgan

1:56 am on Oct 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By default, apache mod_rewrite [httpd.apache.org] does not modify the query string (variables).

Jim

twistedgamer

3:05 am on Oct 21, 2007 (gmt 0)

10+ Year Member



Thankyou

I feel like such and idiot. I so over thought this issue that I couldn't see the answer staring me in the face.

jdMorgan

3:12 am on Oct 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Happens to everyone:

"An expert is one who recognizes a mistake... when he/she makes it again."

Jim

g1smd

4:42 pm on Oct 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Heh. I resemble that remark.

By default I now use RewriteRule rather than Redirect for almost everything. I find the granularity of control much more useful.