Hi there,
I done the one click Ghost install and this works fine.
Then I decided to move my blog: FROM: blog.club.in (ccTLD) TO: blog.club.com (gTLD)
Basically from a ccTLD to a gTLD.
How do I setup a 301 with Nginx to redirect all http and https traffic from my ccTLD to the .com?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Heya,
Sure, here’s how you can set up a 301 redirect using Nginx for your case.
First, you should backup your existing Nginx configuration file:
Next, open the Nginx configuration file in a text editor. I’ll use
nano
for this example:Replace the existing server block for your ccTLD with a new one that includes a
return
directive to handle the redirect:Replace
blog.club.in
with your ccTLD and replaceblog.club.com
with your gTLD. Also, make sure the paths to the SSL certificate and key files are correct.Save the file and exit the text editor.
Check your Nginx configuration for syntax errors:
Now, any traffic to your ccTLD should be redirected to your gTLD.
Keep in mind that it’s recommended to backup your Nginx configuration file before making changes, and always check the configuration syntax before reloading Nginx.