-1

I have added a CNAME from order.checkoutchiangmai.com to restaurant1.acemsweb.com. The result I have is "Apache is functioning normally" when I open order.checkoutchiangmai.com. I am unsure why the restaurant1. domain does not show, as when I check the dig command in terminal it appears correct. Thank you.

order.checkoutchiangmai.com. 3600 IN CNAME restaurant1.acemsweb.com. restaurant1.acemsweb.com. 3600 IN A 27.254.86.7

Phillsav
  • 1
  • 1
  • Do you mean it shows a different site, or an error page? Did you configure this other site in the Apache config or do you expect it to show the restaurant site when you visit the alias too? – tripleee Apr 15 '20 at 04:30
  • 1
    Why would it show? CNAMES are used in DNS resolution (is to find a resource - in this case an IP address of a server). They act at a level a web browser is not even aware of. (Browser asks is to resolve order.checkoutchiangmai.com) and OS resolves came, resolves second cname and gives browser IP address. Browser then connects to server and says "give me page related Yi order.checkoutchiangmai.com" in a header. – davidgo Apr 15 '20 at 06:21

1 Answers1

0

It works as CNAMEs are intended, order.checkoutchiangmai.com points to restaurant1.acemsweb.com which points to an IP. A HTTP request is sent to that IP address, which your default configuration on Apache answers (probably a catch-all rule for any name not specifically configured).

If you want to redirect users from order.checkoutchiangmai.com to restaurant1.acemsweb.com (as if they typed in the address restaurant1.acemsweb.com into the browser) then you need to add a line to your Apache configuration for order.checkoutchiangmai.com that serves a 302 redirect to the user (or 301 if the move is permanent).

Stuggi
  • 3,506
  • 4
  • 19
  • 36