custome domain name cannot display path on heroku - node.js

I am running my APP on Heroku with a name: http://appname.herokuapp.com
Now I have a personal domain: http://www.appname.com
I managed to post my personal domain to heroku name successfully. So when people visit http://www.appname.com, they will be redirected to http://appname.herokuapp.com.
However, the domain path is not displayed. For example, if I have a link on http://appname.herokuapp.com/path/to/destination, I can get that page, but the domain name is always showing http://www.appname.com which is supposed to be http://www.appname.com/path/to/destination.
My APP is written in NodeJS, so if necessary , I can change the route function inside.
Thanks
Derek

You are probably using silent redirects/forwarding features of your domain registrar, which will not work for URL paths. You need to use/configure a DNS server to perform the routing. In your case simply create a CNAME DNS record from www.appname.com to appname.herokuapp.com

Related

Custom subdomain with project page hosted on Github pages

I have already successfully set up a GoDaddy subdomain to point to my personal gh-pages website. This means that my username.github.io webpage is pointing to subdomain.domain.com.
As a consequence of this, all the project gh-pages on my github account are changed accordingly, e.g. a page on repository test-project (which would have been previously hosted at username.github.io/test-project) now is hosted at subdomain.domain.com/test-project.
I would now like to set up my GoDaddy DNS manager in such a way that my test-project gh-page points to a second subdomain, for example project.domain.com.
Now, I know there are plenty of similar questions on stackoverflow, but none of them seems to be solving my specific case. My problem is that I don't know what to add to the CNAME record on GoDaddy. I've tried with both subdomain.domain.com/test-project and username.github.io/test-project , but none of them seems to be working! In particular, if I put username.github.io/test-project, it returns the following error:
Enter either # or a valid host name such as: "subdomain.domain.tld"
UPDATE
I've solved by following this Subdomain of website for Github pages project and having my subdomain CNAME to point to username.github.io. (notice the . at the end). I will do it for any other future subdomain.
Now my question becomes: what does the . do? What does it mean? It is not very clear to me.
The trailing dot at the end is as per RFC defined for fully qualified domain name.
So actually every domain ends with a trailing dot internally. You can actually check this for any website just add a trailing dot in the domain name you will still get the same page. eg.
https://stackoverflow.com./questions/53450113/custom-subdomain-with-project-page-hosted-on-github-pages
So when you make a dns request for domain.com, the browsers stub resolver actually makes a DNS query for domain.com. to the DNS server.
Hop this helps/

How to point a domain to an already existing heroku app, in a way that URL stays unchanged

I bought a domain name, www.toolshedfingerboards.com , and I already have a functioning heroku site here:
http://toolshedfingerboards.herokuapp.com/
I simply want to connect my domain to he heroku, and so I put the CNAME correclt, but when I go to www.toolshedfingerboards.com the URL automatically gets changed (as if an automatic redirect happens) from that of the domain (http://www.toolshedfingerboards.com) to that of heroku's (http://toolshedfingerboards.herokuapp.com/) . What else do I have to change, so that URL does not get changed? Thanks for any help guys!

My website is being redirected to http://guide.domain-error.com/

I created a website with html, css, js, jquery and got a domain name at http://dot.tk.
The name of the website is http://onlinehtmleditor.tk.
But my browser is taking me to http://guide.domain-error.com/search9870798707.php?keyword=onlinehtmleditor.tk/&uri=&uid=57499c974fcbe...
I searched google but the results were solutions to remove domain-error not http://guide.domain-error.com/.
So how do I prevent this?
It means that the DNS records have not been updated yet.
The page you see is provider-specific, I see an other page when visiting your website.
DNS ("Domain Name System") is used to get an IP address from a domain.
When you register a domain, the DNS records have to be actualized, your domain and your server's IP have to be added.
I assume you have already set up a server and assigned it to your domain (otherwise you have to do this in the domain management panel first).
If so, you only have to wait a little.
If you haven't assigned a server yet, do that first and check again a little time after this.
I hope I could help.

How to do a no-DNS site preview, when a wildcard redirect is in place

I'm looking to figure out how to replicate the functionality of GoDaddy's PreviewDNS when I'm moving a site to my own web host based in cpanel.
My setup is this: I have a wordpress multiuser site setup with a subdomain install, and a wildcard redirect.
I can't figure out how I can preview the website for an account before the DNS is switched over to my host from the old host.
I've been able to sorta do this by creating an A record of a subdomain over to my host, but I still have the issue of not being able to test the actual files instead of a copy in a subdomain.
I have two IP addresses attached to the server, one to the server itself and all the shared domains, and the other dedicated to the WP multisite.
When I go to http://ipaddress/~username/, I either get an error, or get redirected to the wordpress multisite's default "this site doesn't exist, sign up now to create it" page. I've tried this with both IP addresses with no avail.
Any ideas?
I think what you're trying to do is ensure that everything is working on the new server before having the DNS globally changed for all users? You could change your local computers hosts file to point the domain (and any subdomains you wish to test) over to the new dedicated IP address, which is essentially moving the DNS over for just yourself.
Here's a pretty good guide on how to do it: http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

Custom Subdomain with CNAME Problem

I am having a bit of a struggle grasping how to use custom domains with my app. Its the common case of having an app that assigns users to subdomains, ex. user.theapp.com and they want to use a CNAME so m.theirsite.com resolves to the application. It seems that most services that do this require you to tell them what your custom domain is, and that just adding a CNAME record doesn't work. Steps:
User creates an account.
We tell them they can make a CNAME entry to yourstuff.theapp.com (which is the current location).
This is my confusion. After 1&2 my custom domain still isnt working.. so once the client makes that CNAME record and provides us with "m.theirsite.com", what special magic do we do with it to make those sites "the same"?
Thank you in advance.
Our solution was to use PHP/MySQL to solve this. As normal, you should have the external domain/subdomain CNAME'd to your app, however as you will see, the CNAME entry doesn't need to be to the exact subdomain on the app. Next, you will build an area into your database where a user can tell you what external site they have CNAME'd from. At this point, you will perform most of your authentication on the website based on the HTTP host, either grabbing the subdomain and using it as a client, or checking if the HTTP host is in your list of CNAME's and then referencing the client from there.
What the CNAME does is just point to a server location, so if you are using wildcards in your apache configuration, foo.myapp.com resolves to the same location as bar.myapp.com, but in the app can use the host to pull out the subdomain and find the client ("foo" and "bar"). When using a CNAME, like m.mywebsite.com --cnamed--> foo.myapp.com, the application no longer has that client information in the HTTP host, and as we mentioned, the apache wildcard setup (*.myapp.com) just tosses out the subdomain.. so because of this the client must tell us "I will be visiting from m.mywebsite.com, so make that a valid host name for my authentication as well."

Resources