Quantcast
Channel: LowEndTalk
Viewing all articles
Browse latest Browse all 59244

[QUESTION] NGINX 301 Redirect, Rewrite vs Return

$
0
0

Hello there! currently I am using rewrites to redirect www.domain.com to domain.com. someone suggested me that instead of:

server {
server_name domain.com;
    rewrite ^/(.*)$ http://www.domain.com/$1 permanent;
}

I should use:

return 301 $scheme://www.domain.com$request_uri;

Since according to him a return is quicker than a rewrite, and $scheme is protocol independent.

What do you think?


Viewing all articles
Browse latest Browse all 59244

Trending Articles