The Protector

Do you have problems ? Get Solution here.

Nginx 301 Permanent Redirect

W3bnetwork.com was built from w3bnet.com with permanent redirect from w3bnet.com

As the result,  w3bnetwork.com is never missed for the w3bnet.com visitor. Permanent Redirect with 301 code is very useful.

Here is how I did.

Open and edit your Nginx server config , usually at /etc/nginx/conf.d/w3bnet.conf

then add these line at the top of server directives

if ($host = ‘w3bnet.com’ ) {
rewrite  ^/(.*)$  http://w3bnetwork.com/$1  permanent;
}
if ($host = ‘www.w3bnet.com’ ) {
rewrite  ^/(.*)$  http://w3bnetwork.com/$1  permanent;
}

$1 means that any requested parameter will be included and  redirected  to target domain.

 

Comment

*