Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Namecheap domain won't redirect without "www"

I'm looking to connect my domain to a heroku app. So far, the tutorials I've read say we want Namecheap to have the following records for domain example.com:

CNAME Record    www    www.example.com.herokudns.com
URL Redirect    @      https://www.example.com

With this config, I can successfully get to my homepage using:

  • http://example.com/
  • http://www.example.com/
  • https://www.example.com/

But for some reason https://example.com/ won't connect and times out. Does anyone know if there's a way to get both https://example.com/ and https://www.example.com/ to redirect successfully?

like image 747
Anim9or Avatar asked Sep 30 '18 19:09

Anim9or


People also ask

How do I redirect a domain without www?

The easiest way of redirecting a non-www URL to www is to place a rule in the . htaccess file. You can do so via FTP, SSH, or your hosting account's control panel.

What is a wildcard redirect Namecheap?

The wildcard URL redirect is used if you want a browser to redirect a non-existent, mistyped or random subdomain to a valid page on your website. But a wildcard DNS record does not cover your root domain (yourdomain. tld), thus you will need to create a new URL redirect record for @ host additionally.

How do I redirect a Namecheap https?

Go to cPanel > Exclusive for Namecheap customers section > Namecheap SSL: 2. Next, click Installed via plugin and switch HTTPS Redirect toggle on. NOTE: HTTPS redirect feature is available if the SSL certificate was installed via the Namecheap SSL plugin only.

What is a wildcard redirect?

What is a wildcard redirect? Also referred to as a wildcard subdomain or catch-all subdomain, this redirecting option allows browsers to reach your site despite the subdomain users' requests, even if the directories are not set up.


1 Answers

You won't be able to do this with DNS provided redirects.

The reason is that at the point of redirect, ie your DNS provider they would need to:

  1. Accept https/443 requests to their redirector
  2. have a valid certificate for hacksofcharity.com

if they don't you'll either receive a timeout, or a certificate mismatch in your browser. When apex domains are involved with https then your only option is to be using a DNS provider that supports using CNAME - see https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain and perform any redirects within your application code base.

like image 124
John Beynon Avatar answered Oct 21 '22 09:10

John Beynon