Redirect WWW to NON-WWW -

Posted July 7, 2020 615 views

I have seen this question posted before with an answer that used to work but following the given instructions gives me errors:

# Determine your secondary URL
ghost config url

# Get Ghost-CLI to generate an SSL setup for you:
ghost setup nginx ssl

# Change your config back to your canonical domain
ghost config url

# Edit the nginx config files for your second domain to redirect to your canonical domain. In both files replace the content of the first location block with:
return 301$request_uri;

# Get nginx to verify your config
sudo nginx -t

# Reload nginx with your new config
sudo nginx -s reload

This method NO longer works and will throw errors out, I am unable to register my www domain.

1 comment
Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!