Problem with redirect

Using a single web hosting account to host multiple sites

Problem with redirect

Postby kanderson » Thu Dec 18, 2008 10:24 am

I have a domain users.animals.org, but for some reason, the DNS provider has pointed to the IP as in http://123.123.123.1. So when I pull users.animals.org, the browser then redirects to http://123.123.123.1/login/index.php, instead of http://users.animals.org/login/index.php. I've tried to fix this with mod_rewrite on my apache server. I set logging to 3, tested from the server, works fine. However, from my desktop, I still get the same problem. Is there any way to fix this or am I up against issues with my DNS provider? Please advise, this is the last piece of the puzzle for this site to launch... my rule looks like this:

Code: Select all
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /

RewriteRule ^/(.*)         http://users.animals.org$1 [R=301,L]
kanderson
 
Posts: 1
Joined: Thu Dec 18, 2008 10:19 am

Postby richardk » Thu Dec 18, 2008 12:46 pm

If the redirect happens for all users.animals.org requests any mod_rewrite to redircet back is likely to cause a infinite loop.

Try
Code: Select all
Options +FollowSymLinks -MultiViews

RewriteEngine On

RewriteCond %{HTTP_HOST} !^users\.animals\.org$ [NC]
RewriteRule ^(.*)$ http://users.animals.org/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 18 guests

cron