[website] www to naked domain redirect

Robert Sink insink71 at gmail.com
Mon Jun 8 02:01:10 PDT 2015


here's a simple nginx example:
server { 
listen 80; 
server_name www.linuxfromscratch.org;
# $scheme will get the http protocol 
# and 301 is best practice for tablet, phone, desktop and seo.
# 301 is permanent if you plan on changing use 302
return 301 $scheme://domain.com$request_uri;
} 
server { 
listen 80; 
server_name linuxfromscratch.org; 
# here goes the rest of your config file 
# example 
location / { rewrite ^/cp/login?$ /cp/login.php last; 
    # etc etc... 
     } 
}

Regards,
Rob

P.S.  Many DNS providers also have capability.  Like setup a www cname.  Good luck.

On May 22, 2015 3:06:27 PM EDT, Robert Sink <insink71 at gmail.com> wrote:
>suggest: add a(n) apache/nginx redirect so that ppl visiting
>www.linuxfromscratch.org get redirected to naked domain [currently
>502].  Google search results seem to show mostly
>www.linuxfromscratch.org links.
>
>Rob
>-- 
>Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/website/attachments/20150608/3d1ef968/attachment.html>


More information about the website mailing list