Forum Moderators: phranque

Message Too Old, No Replies

Redhat/LAMP/Webmin problem

Server novice needing a liitle help (.htaccess)

         

inbound

9:31 am on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not a server guy but I'm helping a client move to a reliable host after their old one went missing in action.

I've got everything set up so that the site serves from the IP address and the 2 domains (they point to the root,not virtual servers).

The problem is when I put in .htaccess as shown below it causes a server error (500)

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.co.uk [NC]
RewriteRule ^/(.*) http://www.example.co.uk/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^/(.*) http://www.example.co.uk/$1 [R=301,L]

It is supposed to send all requests to www.example.co.uk rather than either the non-www or .com versions.

I have a feeling that I need to set up virtual servers for it to know where to get the data, either that or there is a basic error in my .htaccess

Any help would be good

Thanks

inbound

11:25 am on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SORTED:

It was the virtual server issue, and I was able to do the redirects in the config file.