Re: Redirect

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

 



On Wed, Mar 12, 2008 at 7:36 AM, Srikanth NT <ntsrikanth@xxxxxxxxx> wrote:
>
> 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.

You might want to look at http://wiki.apache.org/httpd/CanonicalHostNames

>
> I tried writing a redirection.conf and include in httpd.conf before
> including virtualhosts.conf

In each of your virtual hosts you'll also need
RewriteEngine On
RewriteOptions inherit

>
> RewriteEngine on
> RewriteLog "/var/log/httpd/rewrite.log"

And what exactly do you get in the rewrite.log?

> RewriteCond     %{HTTP_HOST}
> ^(www\.){0,1}my(.)*website(.)*(\.)(com|co\.uk)$ [NC]

That regex is a little over-complicated. Don't group expressions with
() unless you really need to. You probably want something more like
^(www\.)?my.*website.*\.(com|co\.uk)$

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[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