Forum Moderators: phranque
I've tried this:
rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
rewriteRule ^index\.php$ http://www.example.com/forums/ [R=301,L]
But didn't work.
Thanks!
[edited by: jdMorgan at 3:15 am (utc) on Oct. 10, 2005]
[edit reason] Example.com [/edit]
Welcome to WebmasterWorld.
It appears you were *very* close... My guess is this is in your root .htaccess, in which case, you will need to use the full path to the file:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /forums/index\.php\ HTTP/
RewriteRule ^forums/index\.php$ http://www.example.com/forums/ [R=301,L]
Hope this helps.
Justin
[edited by: jdMorgan at 3:16 am (utc) on Oct. 10, 2005]
[edit reason] Example.com [/edit]
Like this:
#Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /forums/index\.php\ HTTP/
RewriteRule ^forums/index\.php$ http://www.example.com/forums/ [R=301,L]
Test this with the Options commented out, then if it does not work, uncomment by removing the #.
If you still get no response, try a test page to make sure mod_rewrite is enabled and you have permission to use it:
#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^test\.html$ http://www.example.com/ [R=301,L]
Type test.html in to your browser and if you are redirected to your home page, then mod_rewrite is on and working, so there must be something we are missing. If not, you probably need to change hosts to use it -- most either allow you to use it or do not.
Let us know how it goes.
Justin
Added: BTW is this in the .htaccess or the httpd.conf file? If it is in the conf file, you will need to change the left side path to start with a / EG RewriteRule ^/forums/index\.php$
[edited by: jdMorgan at 3:16 am (utc) on Oct. 10, 2005]
[edit reason] Example.com [/edit]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /forums/index\.php\ HTTP/
RewriteRule ^forums/index\.php$ http://www.example.com/forums/ [R=301,L] In addition, I find there are other URLs generated by my forum point to the forum index page.
http://www.example.com/forums/index.php?
http://www.example.com/forums/index.php?act=idx
How to rewrite these two URLs?
Thanks!
[edited by: jdMorgan at 3:18 am (utc) on Oct. 10, 2005]
[edit reason] Example.com [/edit]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /forums/index\.php
OR
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /forums/index\.php\?variable=.*\ HTTP/
Justin