Redirect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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.com I 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


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux