mod_rewrite behavior changed with apache 2.2.11 !?

Oh, the strange things mod_rewrite does!

mod_rewrite behavior changed with apache 2.2.11 !?

Postby Creideiki » Thu Jul 30, 2009 2:00 pm

Hi there,

I'm using ubuntu to run a little webserver. Since 7.10 ran out of support I had to update to 9.04.

Nearly everything worked without change (even some mod_perl scripts I wrote).

Only the mod_rewrite rules didn't work any more. They didn't do anything any more.

Ubuntu uses a directory named /etc/apache2/conf.d where additional configurations can be placed, which are included in apache2.conf. There is a directory named /etc/apache2/sites-enabled were are the <VirtualHost> statements placed.

I placed my configurations in conf.d, where I placed Alias, <Location>, <Directory>, and the mod_rewrite statements.

This worked with ubuntu 7.10, but not with 9.04 any more. mod_info told me, that the statements in each file where recognized, but even RewriteLog didn't do anything. The statements were ignored completly.

After much experimenting (and reading in this forum :D ) I figured out that I had to place the mod_rewrite statements in my <VirtualHost> sections.

Now it works, but why? Why did this work in my old configuration and why it changed?

I don't like to fiddle with the sites-enabled configurations; it was much easyer to place anything related in one configuration file...
Creideiki
 
Posts: 2
Joined: Thu Jul 30, 2009 1:36 pm

Postby richardk » Thu Jul 30, 2009 3:37 pm

I don't like to fiddle with the sites-enabled configurations; it was much easyer to place anything related in one configuration file...

You could leave the mod_rewrite in /etc/apache2/conf.d and just add
Code: Select all
RewriteOptions Inherit

to the <VirtualHost>s.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Creideiki » Fri Jul 31, 2009 10:15 am

Oh man... I saw that statement in the docs, but didn't see the point.

Yes, that solves the problem. Many thanks.
Creideiki
 
Posts: 2
Joined: Thu Jul 30, 2009 1:36 pm


Return to Idiosyncrasies

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron