i need redirect to a subfolder, when i go to domain.com, redirect to domain.com/foo. In this time i have a simply apache configuration with Alias /foo /var/www/foo
. I suppose need create a VirtualHost and i have make this:
<VirtualHost *:80>
ServerName domain.com
Redirect permanent / http://domain.com/foo/
</VirtualHost>
But i have too many redirect
error.
I have tried to comment Alias /foo /var/www/foo
and add :
<VirtualHost *:80>
ServerName domain.com/foo
<Directory /var/www/foo/>
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
But i have same error, any idea?
Thanks
If you really don't want to map a virtual host to the directory above /foo (consider Jason's comment), use something like:
This way you will limit redirect to domain root and prevent current redirect loop - all
Redirect
stanzas are applied for locations beginning with the 3rd argument, /foo including, so you also get redirected from /foo to /foo.@Jason mentioned works for me.
very simple, at apache2/htdocs/
create a index.html file, with below content.
http://localhost will go index.html first, then redirect to /glassgov1/ subfolder.
Redirect from a HTML page