views:

21

answers:

2

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!

A: 

I would try writing the full address, so something like:

RewriteRule ^(.*)$ http://www.site.com/$1

and

RewriteRule ^(/)?$ http://www.site.com/index.php [L]
Kerry
A: 

ok i got what was wrong and i thank everyone that had a look at it.

Solution: Change last line

RewriteRule ^(/)?$ mysite/index.php [L]

to

RewriteRule ^(/)?$ mysite/$1 [L]

so it answer to anything coming from that folder not just the index.php :)

warttack
didnt work, browser tricked me. if anyone knows please help.
warttack