Need help with htacess - over and over

Posted by Holian on Stack Overflow See other posts from Stack Overflow or by Holian
Published on 2010-03-13T08:08:25Z Indexed on 2010/03/13 8:15 UTC
Read the original article Hit count: 278

Filed under:
|

Hello!

I have this lines in my .htacess

Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^mydomain.org [NC] 
RewriteRule ^(.*)$ http://www.mydomain.org/$1 [L,R=301]
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
# forum
RewriteCond %{REQUEST_URI} !^/forums/
RewriteRule index.php/(.*) http://forum.mydomain.org/$1 [R=301,L]

This code is works well, but i dont know if the code is standard.

I would like to set htaccess to:

  • mydomain.org go to www.mydomain.org (its ok..)
  • mydomain.org/index.php go to www.mydomain.org (its ok..)
  • forum.mydomain.org stay forum.mydomain.org (its ok..? )
  • www.forum.mydomain.org go to forum.mydomain.org (how?)

Could anyone help me to fix this code?

Thank you.

© Stack Overflow or respective owner

Related posts about apache

Related posts about .htaccess