Tutorial: Redirect your naked domain with SSL on HostGator

HostGator is probable the most known low-cost hosting service. But low cost does not mean easy to use, so sometimes it can get tricky – especially when it comes to linking your naked domains. That's why we have created this guide: to help you redirect your domain.

Step 01: Where does your www domain point to?

CNAME records for naked domain redirection

What happens when you visit "www.yourdomain.com"? If that shows your website, then you can probably jump straight away to the next step. If that throws an error, then the first step is to make your "www" domain show your website. To do that, login into your domain registrar and add an A Record on "www" pointing to the IP from HostGator.

Step 02: Root domain SSL redirection

Watch out! The next steps are tedious and a bit more complicated, and can result in leaving your website offline. We built NakedSSL precisely to avoid dealing with that. Find out if NakedSSL can help you with this.

Test your domain now

http://

You need to have a valid SSL certificate for your naked domain (ie. "domain.com"). You must in this case purchase an SSL certificate and install it in your own server by following the instructions for the provider. Once the certificate is installed, you must redirect your naked domain to your www-domain.

That is the easy part and can be done with a snippet such this (if you're using Nginx):

server {
    listen 443;
    server_name domain.com;
    if ($host = domain.com) {
        rewrite ^(.*) https://www.domain.com:443$request_uri? permanent;
    }
}

Or you can alternative:

server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;
    
    return 301 https://www.example.com$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name example.com;
    
    return 301 https://www.example.com$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name www.example.com;
    
    ====>>> Your site configuration goes here <<======
}

Overwhelmed? No worries, we understand your pain. Forget about all that process and try NakedSSL: it's free for one domain.

Choose a plan that
is right for you

Basic

For freelancers and small agencies. Shared instances, no API.

€0.00

/ month (excl. VAT)
Billed monthly after your 7-day free trial ends.

€9.90

/ year (excl. VAT)
Billed yearly after your 7-day free trial ends.

€5.99

/ month (excl. VAT)
Billed monthly after your 7-day free trial ends.

€59.90

/ year (excl. VAT)
Billed yearly after your 7-day free trial ends.

€17.99

/ month (excl. VAT)
Billed monthly after your 7-day free trial ends.

€179.90

/ year (excl. VAT)
Billed yearly after your 7-day free trial ends.

€34.99

/ month (excl. VAT)
Billed monthly after your 7-day free trial ends.

€319.90

/ year (excl. VAT)
Billed yearly after your 7-day free trial ends.
Try free for 7 days

Volume

For larger use cases on shared instances – API access included.

€53.90

/ month (excl. VAT)
Billed monthly after your 7-day free trial ends.

€539.00

/ year (excl. VAT)
Billed yearly after your 7-day free trial ends.

€83.90

/ month (excl. VAT)
Billed monthly after your 7-day free trial ends.

€839.00

/ year (excl. VAT)
Billed yearly after your 7-day free trial ends.

€119.90

/ month (excl. VAT)
Billed monthly after your 7-day free trial ends.

€1,199.00

/ year (excl. VAT)
Billed yearly after your 7-day free trial ends.
Try free for 7 days
API Access Included – View docs here

Enterprise

Dedicated IPs and instances, premium support – among others.

API Access Included – View docs here