Forum Moderators: mack

Message Too Old, No Replies

A record redirect to .htaccess file

Help with server redirect.

         

jamieg

10:39 pm on Oct 2, 2004 (gmt 0)



One of my clients is pointing his domain (http://domain-ny.com) to the IP address of my server.

I'm trying to set up an .htaccess file to direct all requests to the root of the server to a new domain [domainny.com...]

The following works for redirecting the IP when I type it in but not the request for [domain-ny.com...]

#############################################
RewriteEngine on
RewriteRule /* [domainny.com...]
#############################################

Any thoughts?

mack

9:06 pm on Oct 3, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



You might be better to try and set up a virtual host in your httpd.conf file (assuming you are on apache)

<VirtualHost *>
ServerName www.example.com
DocumentRoot /path/to/www/html/
</VirtualHost>

If are not sure what you are doing with httpd.conf I recomend backing it up before you make any changes. It's a nightmare when you make a change then apache doesnt function correctly.

After you add the virtual host entry restart apache.

Mack.