Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

non-www to www only

$
0
0
An SEO tool I am using has made this suggestion:

Quote:
Some websites have www in front of their domain, like www.google.com. Others don't, like dribbble.com.

If your website works on the domain www and the one without, you have two identical websites on a different URL. Google will consider that duplicate, and lower your rankings.

There's an easy fix: redirect all your traffic to www. If you have an Apache server, add this to your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

However, I am using Nginx and not Apache so that "easy fix" isn't applicable to me. Here is my config file for Nginx:

Link: https://pastebin.com/zsKbtawz

Any assistance would be greatly appreciated.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>