1

My primary web site uses PHP/Zend Framework, and the .htaccess is the common one:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Now I need to bring a forum (in another directory) to the main site. I added an Alias directive inside VirtualHost

Alias /forums "h:/projects/forums"

The forum software uses its own .htaccess. The main URL /forums is accessible but not others. Other URLs (those who do not have corresponding files) are forwarded to the main site. In other words, the .htaccess file of the main site (/) is picked up, not the one under /forums directory.

hakre
200k55 gold badges454 silver badges868 bronze badges
asked Apr 6, 2011 at 15:38

1 Answer 1

2

Try adding a new RewriteCond to tell your main .htaccess file to ignore requests under /forums. After the request passes through that file, it should get picked up by the /forums/.htaccess file, though I'll admit that I'm not really sure if Alias affects this.

The condition would look like this:

RewriteCond %{REQUEST_URI} !^/forums [NC]

This says "only perform the next RewriteRule if the request doesn't begin with /forums". The [NC] at the end says to ignore the casing on /forums so it won't matter if the request is actually for /Forums or /FORUMS.

answered Apr 6, 2011 at 19:41
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.