Re: [users@httpd] basic rewrite question concerning redirect : ^$ or ^/$

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

 



On Tue, 15 Mar 2005 11:29:43 +0100, Hanack Leif
<Leif.Hanack@xxxxxxxxxxxxx> wrote:
> Hello,
> 
> i detected a strange behaviour:
> 
> I have two vhosts:
> 
> <VirtualHost *:80>
>     ServerName intra-jawa.com
> 
>     RewriteEngine on
>     RewriteRule ^$ http://intra-jawa.com/portal/login.jsp [R,L]
>     ...
> </VirtualHost>
> 
> <VirtualHost *:80>
>     ServerName intra-jawa1.com
> 
>     RewriteEngine on
>     RewriteRule ^$ http://intra-jawa1.com/portal/login.jsp [R,L]
>     ...
> </VirtualHost>
> 
> When i call http://intra-jawa.com i'm redirected to the login page.
> Calling http://intra-jawa1.com i receive a 403 : Access denied.
> 
> Why?
> 
> Changing the rule to
> 
>     RewriteRule ^/$ http://intra-jawa1.com/portal/login.jsp [R,L]
> 
> will forward to the login page even if i just enter the
> domain http://intra-jawa1.com without a trailing /

Use the RewriteLog to figure out what is going on.  In my opinion,
both of them should be using the ^/$ syntax.  The URL-path used by
RewriteRule will start with a slash when it is used in a server-wide
of <VirtualHost> context.  It is only when it is used in a <Directory>
or .htaccess file that the / will be missing.

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