RE: [users@httpd] mod_rewrite problem

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

 



OK apologies, it does work.  I setup a test virtual server copying the
defintion from the live server, pointing to he same files and the test
one works. Odd odd odd.

Tail from the live VS:

172.16.2.254 - - [22/Aug/2005:09:44:46 +0100]
[domain.com/sid#8101e20][rid#84424a0/initial] (1) pass through /abbey

Yet on the test VS:

172.16.2.254 - - [22/Aug/2005:09:41:54 +0100]
[test/sid#81031e0][rid#844cc08/ initial] (1) pass through /abbey/
172.16.2.254 - - [22/Aug/2005:09:41:54 +0100]
[test/sid#81031e0][rid#8481e00/ subreq] (2) init rewrite engine with
requested uri /abbey/index.html
172.16.2.254 - - [22/Aug/2005:09:41:54 +0100]
[test/sid#81031e0][rid#8481e00/ subreq] (3) applying pattern
'^/([^/]*)/?$' to uri '/abbey/index.html'

There's no call to the rewrite engine on the live server.


Not sure what could be causing that ... here's the defintion and as you
can see they are the same - except for a ServerAlias line.

Live:
<VirtualHost 172.16.2.120>
        DocumentRoot /var/www/epp/htdocs
        ErrorLog /var/www/epp/logs/epp.error_log
        ServerAdmin nick.gushlow@xxxxxxxxxxxxxxx
        ServerName domain.com
        ServerAlias www.doman2.com
        CustomLog /var/www/epp/logs/epp_combined.access_log combined
        DirectoryIndex index.html index.php index.htm index.shtml
        ErrorLog /var/www/epp/logs/epp.error_log
        RewriteLog /var/www/epp/logs/epp.rewrite.log
        RewriteLogLevel 9
        DirectoryIndex index.html index.php index.htm index.shtml
        RewriteEngine on
        #RewriteBase /

        ## Axel-Stephane Smorgrav fix
        RewriteCond %{REQUEST_URI} !^.*\.(php|gif|jpg|html?|css|js|doc|
pdf)$
        RewriteCond %{REQUEST_URI} !abbey
        # Krist van Besien fix
        #RewriteRule  .*abbey.*    -   [L]
        RewriteRule ^/([^/]*)/?$ /index.php?epp=$1         [L]

</VirtualHost>


Test:
<VirtualHost 172.16.2.120>
        DocumentRoot /var/www/epp/htdocs
        ErrorLog /var/www/epp/logs/epp.error_log
        ServerAdmin nick.gushlow@xxxxxxxxxxxxxxx
        ServerName testepp
        CustomLog /var/www/epp/logs/testepp_combined.access_log combined
        DirectoryIndex index.html index.php index.htm index.shtml
        ErrorLog /var/www/epp/logs/testepp.error_log
        RewriteLog /var/www/epp/logs/testepp.rewrite.log
        RewriteLogLevel 9
        DirectoryIndex index.html index.php index.htm index.shtml
        RewriteEngine on
        #RewriteBase /

        ## Axel-Stephane Smorgrav fix
        RewriteCond %{REQUEST_URI} !^.*\.(php|gif|jpg|html?|css|js|doc|
pdf)$
        RewriteCond %{REQUEST_URI} !abbey
        # Krist van Besien fix
        #RewriteRule  .*abbey.*    -   [L]
        RewriteRule ^/([^/]*)/?$ /index.php?epp=$1         [L]


</VirtualHost>


I'm using apache 2.0.46.

Do you think that server alias line could be the problem?

Nick.

On Fri, 2005-08-19 at 14:45 +0200, Axel-Stéphane SMORGRAV wrote:
> What version of Apache are you running?
> 
> Try adding 
>  DirectoryIndex index.html
> to your configuration and restart the server. If you get an error, you do not have mod_dir loaded. You can also check your LoadModule directives for one loading mod_dir, or do httpd -l to see if it is statically linked into the httpd binary. You can also do GET http://myhost.foo.bar/server-info and look for the mod_dir configuration (if you have that moduled installed...)
> 
> I am using Apache 2.0.54 and it works perfectly. I set up a test VH to test the rules I posted previously. I replaced abbey with manual and did GET http://labelle16.foo.bar:81/manual. Got a redirection (HTTP 301) to http://labelle16.foo.bar:81/manual/ and the manual index page was displayed.
> 
> The rewrite rules are not the cause of your problem.
> 
> -ascs
> 
> -----Original Message-----
> From: Nick Gushlow [mailto:nick.gushlow@xxxxxxxxxxxxxxx] 
> Sent: Friday, August 19, 2005 1:04 PM
> To: Krist van Besien
> Cc: users@xxxxxxxxxxxxxxxx
> Subject: Re: [users@httpd] mod_rewrite problem
> 
> First off thanks for your help, I clicked reply not reply all before so I wanted to say thanks publicly so I don't look too ungrateful. :-)
> 
> On Fri, 2005-08-19 at 10:57 +0200, Krist van Besien wrote:
> > > 
> > > RewriteCond %{REQUEST_URI} !^.*abbey(.*)
> > 
> > A better way to "short circuit" is just to add a
> > 
> > RewriteRule  .*abbey.*    -   [L]
> > 
> > before the existing rule. This keeps the URL unchanged.
> 
> That rule didn't work for me and stopped the other rule working correctly.
> 
> I need to get my test server back up got it down for other purposes atm, then I'll get some logs posted to show what happened.
> 
> Nick
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> ______________________________________________________________________
> This email has been scanned for Viruses by Westcoast's SMTP Protection Service.
> 
> ______________________________________________________________________

---------------------------------------------------------------------
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