Hi
recently we moved our servers to a different place and so we want to
redirect the pages hitting the previous server to the new server location.
Also we need to workout to redirect site address wrongly typed. Say for
example, instead of http://www.mywebsite.co.uk if user enters
my-website.comI want it to get redirected properly.
I tried writing a redirection.conf and include in httpd.conf before
including virtualhosts.conf
RewriteEngine on
RewriteLog "/var/log/httpd/rewrite.log"
RewriteLogLevel 9
*RewriteCond %{HTTP_HOST}
^(www\.){0,1}my(.)*website(.)*(\.)(com|co\.uk)$ [NC]
RewriteRule ^(.*)$ http://www.mywebsite.co.uk [R=301,L]
RedirectMatch ^/$ http://www.commonwebsites.co.uk/
*
If non matches, I want it to get redirected to the parent website. When I
tested it with my-website.com, it is redirecting me to commonwebsites.co.uk
I dont understand the reason. Googled enough but no idea.....
Thanks in advance,
Sri