Nginx redirect homepage only

By.

min read

My profile

Share this:

[code:1:c8b9f9d274]server {
(..)
location / {
rewrite ^(/)$ http://www.domain.com/ permanent;
}
}[/code:1:c8b9f9d274]

This will redirect ONLY home, but not files or directories in your url.

Source http://stackoverflow.com/a/22562401/696680

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *