Forum Moderators: phranque
I am new to this forum and also to the area where I hope someone can help me out. I am trying ro redirect requests for a few domain names to different files using mod-rewrite but am coming unstuck. I do know that mod-rewrite is enabled for my use.
I am trying to redirect as follows:
www.example.co.za must redirect to www.example.co.uk/about.php
and..
www.example.co.za must redirect to www.example.co.uk/about.php
The code I have inserted in my .htaccess file is as follows which is causing the webserver to say I have not uploaded an index file at www.example.co.uk:
-----------------------------------------------
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?example\.co.za
RewriteRule .* http://www.example.co.uk/about.php [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?example\.co.za
RewriteRule .* http://www.example.co.uk/about.php [R=301,L]
-----------------------------------------------
If anyone in the know can assist, i'd really be greatful.
Brad
[edited by: jdMorgan at 3:30 pm (utc) on July 29, 2005]
[edit reason] Obscured specifics per TOS. [/edit]
Welcome to WebmasterWorld!
Your code looks fine, which means it should work *if* it is executed for requests for your .za domains. So, that is one problem: You need to make sure that those domains resolve to the directory where this code is installed.
You say that you know that mod_rewrite is installed, but do you know if it works? A simple test is to place a rule like:
RewriteRule ^silly\.html$ /index.php [L]
If it does not work, check your server error log; It will often tell you exactly what's wrong.
Jim