Quote:
|
Originally Posted by cardesign
Basically I have set up some add on domains but I want it to forward to these if going to the exact url.
e.g. you can currently go to www.mysite.com/myaddondomainad/ and also www.myaddondomainad.com
Basically what I want is for it to forward to the domain name address if you go to the directory bit.
|
Use the following code and save it as .htaccess
Transfer it to the web-root on your server.
[code:1:f86839489e]
Redirect 301 /old-page.html http://www.new-url.com/old-page.html
Redirect 301 /myaddondomainad/ http://www.myaddondomainad.com
<Files .htaccess>
order allow,deny
deny from all
</Files>
[/code:1:f86839489e]
The first line should be applied to individual pages (you need to change "old-page.html" for your own application).
The last 4 lines prevent the .htaccess file from being read through a browser.
For future reference, here's the official apache site
http://httpd.apache.org/docs/mod/mod....html#redirect