apache mod_rewrite redirection problem

Posted by warttack on Stack Overflow See other posts from Stack Overflow or by warttack
Published on 2010-05-23T03:33:20Z Indexed on 2010/05/23 3:40 UTC
Read the original article Hit count: 297

Filed under:
|

ok i am having a problem with redirection on apache, i have a domain configured on my hosting account but the domain needs to be redirected to a folder. eg: / is root of server where the mysite.com answers /mysite is where the files are so i got this htaccess code to do the job:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteCond %{REQUEST_URI} !^/mysite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /mysite/$1
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^(/)?$ mysite/index.php [L]

plus i made an index.php to redirect to mysite folder. everything seems to be working good the only problem is i added a forum on /mysite/forums/ and for some reason instead of getting mysite.com/forums/ in the browser im getting mysite.com/mysite/forums/

could anyone help me solve this problem? Thanks in advance!

© Stack Overflow or respective owner

Related posts about apache

Related posts about mod-rewrite