/    Sign up×
Community /Pin to ProfileBookmark

SEO Friendly NGINX Redirects

Hi Everyone,

I decided to use the Ghost blogging system on my new site, just to experiment. I’ve managed to send all visitors who type HTTP to be sent over to HTTPS, but I can’t seem to do this for visitors who type WWW. Would really appreciate if anyone can shed some light on how to do this that is SEO friendly, i.e. a permanent redirect.

[CODE]server {
listen 80;
server_name www.mydomain.com;
rewrite ^/(.*) https://mydomain.com/$1 permanent;
}

server {
listen 80;
listen 443 ssl;
listen [::]:80 default_server ipv6only=on;

server_name mydomain.com; # Replace with your domain
…..remaining code goes here
}[/CODE]

Many thanks

to post a comment
SEO

0Be the first to comment 😎

×

Success!

Help @jackb2000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...