[CentOS] apache redirect rule

Thu Jul 23 15:34:17 UTC 2009
David Hláčik <david at hlacik.eu>

Thank you Filipe,

It works, have a nice day.

David

On Thu, Jul 23, 2009 at 5:28 PM, Filipe Brandenburger
<filbranden at gmail.com>wrote:

> Hi,
>
> On Thu, Jul 23, 2009 at 10:46, David Hláčik<david at hlacik.eu> wrote:
> > RewriteCond %{HTTP_HOST} extensions.polarion.com
> > RewriteRule / http://extensions.polarion.com/polarion/extensions/
>
> Usually those would be regexps, so the right syntax for what you want
> would be something like:
>
> RewriteCond %{HTTP_HOST} =extensions.polarion.com
> RewriteRule ^/$ http://extensions.polarion.com/polarion/extensions/
>
> The "=" in RewriteCond forces it to treat the second parameter as a
> string (if that does not work for you, try ^extensions\.polarion\.com$
> instead.)
>
> In the second rule, you want to redirect only requests to /, so you
> need to anchor it with ^/$.
>
> And don't forget that you will also need:
> RewriteEngine on
>
> Other than that, it should work fine. But I suggest you test these
> rules in a test environment first before commiting them to your
> production machine.
>
> HTH,
> Filipe
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20090723/1a2b6324/attachment-0005.html>