How to load webpage without using www - .htaccess

Im hosting on 000webhost. If I type my www.example.com or http://www.example.com it loads. If I type example.com or http://example.com it doesn't load. Is there a fix for this please? As this is particularly important for mobile phone users.
I have been in contact with godaddy.com but the guy tries to do what I have tried already:
CNAME -- www -- example.000webhost.com -- TTL 1 hour (this one goes in)
CNAME -- www -- # -- TTL 1 hour (this one refuses to work) Its rejected by Godaddy
Im getting an error message "please contact Godaddy support", but this is not working as they don't know how to solve the issue.

Related

Why does having a www CNAME in Cloudflare does not work and return Error 523

Hey so How to setup CNAME DNS for www to point towards the root domain. The Root cname works but the www CName doesn't. i have it like the this
I have my react page hosted on Cloudflare pages, but when I go to https://www.stron.ml It returns the following error. I am kinda new to web hosting stuff .
Error 523
Ray ID: 650b0c9bcc380b97 • 2021-05-17 07:14:30 UTC
Origin is unreachable
I tried even adding a subdomain like dev. but I got the same error ,
Thank You
at the moment your redirection seems working, it could've been simply a matter of propagation time.
Anyway, keep in mind that pointing a CNAME to another CNAME is discouraged by the official RFC, so pointing your www subdomain to stron.ml, while stron.ml is already a CNAME should be avoided:
Don't use CNAMEs in combination with RRs which point to other names like MX, CNAME, PTR and NS.

How to Point www and Non www site to an ALB in Route53

I want to point www.example.com and example.com to a server behind the ALB in such a way that whenever someone types www.example.com or example.com he will always go to www.example.com. following are my records
example.com A simple yes dualstack.[alb].com
example.com NS simple no ns.[].com etc....
example.com SOA simple no ns.[].com etc...
www.example.com A simple yes dualstack.[alb].com (same as the first record in the list)
currently it is always going to exmple.com regardless of what we type example.com or www.example.com and site is working perfectly. But I want to alway go to www.example.com regardless of what I type in the search bar www.example.com or example.com....
What records should I put here to achieve this task???
Please ensure that the redirection is not done by your application server.
Assuming that you use Application Load Balancer you could use listener rules to handle redirection to www. domain.

configuring heroku hobby dyno with a namecheap domain at root level

This question is highly similar to this, but barely different:
configuring namecheap domains with heroku
Here is what I have (for the purposes of hiding the original site, I have omitted its name for the string 'asdf'):
A namecheap domain titled as follows: asdf.com
A herokuapp running on a dyno that is hobby level that also has ACM set for automatic certificate management. It is running at https://asdf.herokuapp.com/ and this link works and gets my pushes from github integration. It is awesome :)
I want to link these up so that instead of having my site as https://asdf.herokuapp.com it would instead be https://asdf.com, so that is why I went and bought the namecheap domain for it, but linking these together I have failed at every opportunity. I have tried many different patterns but unfortunately I'm unknowledged on this layer of things. Here is something I have tried, but does not work:
On Heroku: Create a custom domain of: asdf.com
Heroku then supplies me with: asdf.com.herokudns.com
I then go into namecheap, and remove any and all possible cnames or redirects.
I create a new CNAME | host: www | target: asdf.com.herokudns.com
When trying to hit the site, I get this error:
ERR_NAME_NOT_RESOLVED
If I try changing CNAME host to # on namecheap, I get:
ERR_SSL_PROTOCOL_ERROR
Any help is greatly appreciated, and if more information is needed just ask.
Thank you.
I am experiencing the same issue. I've contacted Namecheap and Heroku both for support. This is what I've come up with, but my domain is still not resolving.
Since you're pointing www.mollydwellness.org at your app, you'll need to make sure you've added that to your Heroku config (currently you only have the non-www version assigned):
$ heroku domains:add www.mollydwellness.org --app mollydwellness
Once that is added, you should receive a new DNS target that you'll need to use to update your CNAME record.
$ heroku domains
=== mollydwellness Heroku Domain
mollydwellness.herokuapp.com
=== mollydwellness Custom Domains
Domain Name DNS Record Type DNS Target
────────────────────── ─────────────── ────────────────────────────────────
www.mollydwellness.org CNAME www.mollydwellness.org.herokudns.com
mollydwellness.org ALIAS or ANAME mollydwellness.org.herokudns.com
Namecheap Config
Type Host Value TTL
CNAME Record www
www.mollydwellness.org.herokudns.com.
5 min
URL Redirect Record
#
http://www.mollydwellness.org/
Unmasked
I am told to give it another 30 minutes before contacting support again. It's been 45 minutes and still not resolving.
Very confused, probably just going to deploy it myself to a VPS because that would be easier at this point. I went with Heroku to save myself time, but it appears there can be no shortcuts. More help from the community would be great.
the only thing you need to do for dns, is going to heroku, setting the following on the custom domain :
*.mywebsite.com
mywebsite.com
www.mywebsite.com
on Namecheap you do the following configuration:
CNAME Record # myapp.herokuapp.com. 1 min
CNAME Record www myapp.herokuapp.com. 1 min
URL Redirect Record # https://www.myapp.herokuapp.com Unmasked
URL Redirect Record www https://www.aipredictor.herokuapp.com Unmasked
and you are done. that covers all of the possible scenarios.

5 characters appearing in URL

I've been having an issue off and on, hard to reproduce, but happening reasonably regularly.
I have static files on Azure blog storage, and here's the setup - a lot of steps to set up, but it works most of the time - I used this blog as my guide:
index.html lives on the "webfiles" container in blob storage
the CDN points to /webfiles
there's a URL rewrite in the CDN setup from / to /index.html
DNS redirects http://example.com to https://www.example.com
DNS for www points to the CDN URL
When I go to http://example.com, 9 times out of 10, it properly redirects to https://www.example.com/ and loads the index.html page. However, sometimes, and it seems to generally be on a clean browser with no history, it'll send me to something with 5 extra characters, like https://www.example.com/VeVPe/ where I get a 404 and a BlobNotFound exception - I have no idea what VeVPe is, and it seems to be different for different sites. I have 5 sites set up like this, and it happens to all of them.
If I remove that 5-letter (always seems to be letters, never numbers, but that could just be coincidence) and hit ENTER, it loads properly and I get index.html, or if I just try http://example.com a second time, it works properly. Just seems to be one time.
I've also seen it happen to other sites in the public - there's a local school where the website sometimes redirects me to http://www.example.com/LNnZS/ and a 404 page - that one seems to be the same thing, but it's not HTTPS, so that seems to eliminate at least some of the possible causes. I don't know who their DNS or hosting providers are, so I don't know if it's specific to Azure or GoDaddy.
This happens on Chrome and Edge on desktop and Safari on iPhone, so it's not a browser or computer issue.
If it helps, here's what the URL redirect and rewrite look like on Azure:
EDIT I'm seeing something interesting when I can catch it in browser tools:
The initial request to http://example.com goes to GoDaddy's IP and returns a 302 Found to Location /KVZQZ/. Then there's a request to http://example.com/KVZQZ/ which is returned by GoDaddy's IP with a 301 with a Location https://www.example.com/KVZQZ/, and the third request actually makes it to Azure's IP which returns the 404 for BlobNotFound.
So to me, this looks like it's a DNS problem, not a problem with Azure. My DNS settings are:
A # Forwarded to https://www.example.com
CNAME www example.azureedge.net
On the forwarding section of the DNS setup, it just forward to https://www.example.com with a 301 forward type. So from what I can tell, nothing too funky here.
After a lot of Googling - This forum post shows lots of people who have had the same problem where 5-letter codes get added to their site. It's apparently specific to GoDaddy and no one has been able to convince them to address it. Their workaround is to throw a query string on the forwarding address.
I changed the forwarding address from https://www.example.com to https://www.example.com? and it's working ok now.
I made a request in the browser to http://example.com and it redirected me to https://www.example.com/?/MKSTc/ and loaded up the index.html page - obviously this is not ideal because it's ugly, but I suppose I can write some javascript to do a second redirect back to https://www.example.com/

Is my website www or without www subdomain?

This seems like a really stupid question, but I can't tell if my website uses the www subdomain or without.
I purchased an expired domain a month ago and set up Google Webmastertools with a sitemap and all. It's indexed, but when searching for the website name, it's no where to be found. Webmastertools says that 'no data is available.' The support states that the www subdomain may be a factor.
How can I verify this? I've used info: domain.com, site: domain.com, info: www.domain.com and site: www.domain.com It pulls up domain.com
Thanks in advance!
Need to find whether the both www and non-www are pointing to same IP address. For this, Open command prompt (click start button >> run >> provide code "cmd"). Once command prompt is launched, then run the code "Ping domain.com" you can find a IP address and then run "ping www.domain.com" and you get another IP address. If both IPs are different then you have setup A record in DNS.
If they are same IP address, non-www need to redirect www or www redirect to non-www. To find this, provide both URLS on http://www.redirect-checker.org/ find out which are getting 200 status. The 200 status URL are need to be added on webmastertool.
Let me know if you need further help.
Who is handling the DNS? If you own domain.com, the www. is (as you said) a subdomain.
You can register any subdomain you want as long as you are pointing it to somewhere. For example if I set up domain.com with DNS pointing to the hosting I would create an A record for the subdomain www that points to the same IP address.
From there I would check the Host server and (I use IIS) make sure that the bindings for the domain are set up, usually I bind it to www.domain.com as default and then just send domain.com there.
I hope this helps answer your question

Resources