Forum Moderators: phranque
I'm currently trying to construct a redirect 301 RewriteRule which will convert requests for any file in /forums/ to requests for the same file in the /forum/ directory. However, since the forum is dynamic PHP and using query strings I need the rule to retain the query.
I've tried rules such as:
RewriteRule /forums(.*)$ [mysite.com...]
and
RewriteCond %{REQUEST_URI} ^/forums/$ [NC]
RewriteCond %{QUERY_STRING} ^(.*)$
rewriterule ^(.*)$ [mysite.com...] [R=301,L]
but they don't work. The closest thing that I've got to it so far is:
RedirectMatch permanent /forums(/)? [mysite.com...]
but of course all query string info is lost.
Can someone (Jim *gggg*) suggest a solution, please?
Thanks in advance.
RewriteBase /forums/
RewriteRule ^(.*)$ [mysite.com...] [R=permanent,L]
These statements need to be in the .htaccess file in the /forums directory
A request for...
[mysite.com...]
results in (once I'd removed the rule)...
[mysite.com...]
It also affected all other pages. :-(