Hi all,
In a shared FreeBSD hosting with no access to httpd.conf, I'm trying to redirect subdomains to different document roots using mod_rewrite.
I'm using this rule in a .htaccess file placed in DocumentRoot:
This works as expected accessing
while
fails as it's redirected to local path
instead of
Please note that trailing slashes are automatically added to any rule but the ones rewritten by this rule.
Where's my fault?
Thanks in advance.
In a shared FreeBSD hosting with no access to httpd.conf, I'm trying to redirect subdomains to different document roots using mod_rewrite.
I'm using this rule in a .htaccess file placed in DocumentRoot:
Code:
# Change document root for foo.mydomain.com
RewriteCond %{SERVER_NAME} foo.mydomain.com
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule .* /foo%{REQUEST_URI} [QSA,L]
This works as expected accessing
Code:
foo.mydomain.com
foo.mydomain.com/
foo.mydomain.com/bar/
while
Code:
foo.mydomain.com/bar
fails as it's redirected to local path
Code:
/foo/foo/bar
Code:
/foo/bar
Please note that trailing slashes are automatically added to any rule but the ones rewritten by this rule.
Where's my fault?
Thanks in advance.