Hello,
I use multiple 301 redirects on my server.
I have one to redirect my domain without www to the www version ( "domain.com" => "www.domain.com" ),
and I also have one for the root to redirect users to my site's main page ( "/" => "/wiki/Main_Page")
My concern is that I'm creating a string of 301 redirects. If I type in domain.com, I get transferred to www.domain.com and then on that page I get transferred once more to www.domain.com/Main_Page.
I guess I could create a redirect for this special case, but I'm wondering if there is a more appropriate way of telling my server not to redirect the traffic until all the rules have taken place?
I'm using nginx, and my conf file looks like:
server {
listen 80;
server_name domain.com;
rewrite ^/(.*) http://www.domain.com/$1 permanent;}
server {
listen 80;
server_name www.domain.com;
location / {
...
rewrite ^/$ /w/index.php last;}
location ~ /wiki/ {
rewrite ^/([^?]*)(?:\?(.*))? /w/index.php?title=$1&$2 last;}
...}
Thanks for any help.