Forum Moderators: phranque

Message Too Old, No Replies

Two separate Rewrite rule files creating problem.

         

newlearner2006

1:18 am on Mar 16, 2006 (gmt 0)

10+ Year Member



Hi,

I would try my best to describe the problem.
I have two files say fileA and fileB both having rewrite rules which are independent of each other.

These are both lying in the apache conf/include directory.

fileA
<VirtualHost *>
ServerName example.com
DocumentRoot .....

RewriteEngine On
RewriteLog "logs/rewrite.log"
RewriteLogLevel 9

RewriteRules....

</VirtualHost>

fileB

<VirtualHost *>
ServerName example.com
DocumentRoot .....

RewriteEngine On
RewriteLog "logs/rewriteN.log"
RewriteLogLevel 9

RewriteRules....(Indepent of fileA)

</VirtualHost>

I am observing this behavior -
when apache starts it processes fileA and fileB in that order.

Now all the rewrite rules present in fileA work and rewrite.log is being written to as I would expect.

None of the rules present in fileB work and nothing is written to rewriteN.log.

*****************************************

Suppose I change the names of the files so that apache processes them in the order fileB and file A.

Now all the rewrite rules present in fileB work and rewriteN.log is being written to as I would expect.

None of the rules present in fileA work and nothing is written to rewrite.log

**********************************************
I expected both the files to have taken effect and both should have worked simultaneously but it seems the first file whichever it is hides the second file completely.

Is this normal?
I am quite baffled because uptill now I was just testing with one file and I was doing ok.
Now as part of integration I dropped my file in the include directory and this behavior started happening.

I an really at my wits end. Please help..

Thanks.

jdMorgan

2:11 am on Mar 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since both files seem to apply to the same VirtualHost, it's not clear why you need two files.

I cannot answer your question, since I've never tried using two configuration files for one VirtualHost, but I am not surprised that it does not work, as there are some possible security-related concerns.

Jim