Mobile app version of vmapp.org
Login or Join
YK1175434

: What could cause my site to redirect to its IP address using Apache2? I've been playing around with various web configurations in Debian for about a year now. I've set up DNS for a fow

@YK1175434

Posted in: #Apache2 #Domains #Redirects

I've been playing around with various web configurations in Debian for about a year now. I've set up DNS for a fow domains in the process and have never really had an issue. I:


Go to Google domains and point the DNS at my ip
Go to digital ocean and do the same thing
Set up Server Name and Server Alias in my sites-available config file


Then I'm off to the races.

However this time around after doing those things, my site will resolve if I use the domain name, but the URL changes to show the IP address once the page has loaded.

I don't even know how this could happen or what information someone would need to know what's causing it. What could be going wrong?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @YK1175434

1 Comments

Sorted by latest first Latest Oldest Best

 

@LarsenBagley505

... but the URL changes to show the IP address once the page has loaded.


This is only possible via post javascript processing of the page. Somewhere in the javascript code, there is a line instructing the web browser to replace the contents of the address bar with the IP address.

The only other possibility is that your web browser may contain a virus or it might have been created poorly.

If however you worded your question wrong and you're trying to say "the URL in the address bar changes to the IP address before the page has finished loading" then you have an HTTP response from accessing the URL itself that indicates a redirect to the IP address.

Go to redbot.org and put in followed by your domain name (no spaces) and press enter to see results.

If the first line of the response starts with any of the following:

HTTP/1.1 301
HTTP/1.1 302
HTTP/1.0 301
HTTP/1.0 302


Then its redirecting to another URL which is listed next to the line beginning with:

Location:


That URL is likely the IP address you're complaining about.

If you want to investigate more, you can visit webpagetest.org and put in your domain there and in the results, access the waterfall section (where you see how long each request takes) and if you see yellow bars, then that means at least one redirect to another URL happened.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme