On Thu, Mar 8, 2012 at 5:21 PM,  <maillis...@gmail.com> wrote:
> newb question.
>
> I need to redirect everything from www.mysite.com/admin and
> mysite.com/admin to admin.mysite.com. Because several boxes share the
> same configuration and some of them will serve admin.mysite.com, I
> can't use a plain redirect.
>
> This rule to do the redirect, and every variation I've tried, doesn't
> ever match:
>
> RewriteCond %{HTTP_HOST}     !^admin\.mysite\.com$ [NC]
> RewriteRule  ^/admin                  https://admin.mysite.com [R=301,L]
>
> What am I missing? Any help is greatly appreciated.
>

If you're in <Directory> or htaccess context, the part of the URL that
lead you to that context, including a trailing slash, is stripped from
the string you're comparing to.

So if this is in the docroot, RewriteRule compares against "admin" not
"/admin" since / is stripped out.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to