View Full Version : [ubuntu] "server1" redirects to IP address

April 29th, 2008, 07:21 PM
I have 8.04 server installed and a website at server1/site (or server1/ave411/public_html/site).

When I put "server1/site" or "192.168.x.xx/site" in the browser address bar, it redirects to my IP address, or 72.xxx.xxx.xx/site. This way, I'm not really accessing the site over the network, am I? Why does this happen?


April 29th, 2008, 07:55 PM
If you're being redirected, then either a redirect is being added to your http header by an apache module (mod_rewrite) or web script (php,perl), or the page you are accessing uses javascript (window.location) or a meta refresh to redirect you.

Post this output

wget http://server1/site -O - |grep http://

April 29th, 2008, 10:23 PM
Here's the important part. Everything after that is just the html from the fetched page:

wget http://server1/xgal -O - |grep http://

--17:16:13-- http://server1/xgal
=> `-'
Resolving server1...
Connecting to server1||:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://server1/xgal/ [following]
--17:16:13-- http://server1/xgal/
=> `-'
Reusing existing connection to server1:80.
HTTP request sent, awaiting response... 302 Found
Location: [following]
=> `-'
Connecting to connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

April 29th, 2008, 10:52 PM
I think I know the cause. This is a Xoops site, and in mainfile.php, the Xoops url is So, Xoops is doing the redirecting. So, thanks. I can take it from here. If I get stuck, I'll post again.