Ignore directory....

Using mod_rewrite to handle various content issues

Ignore directory....

Postby bubbagump » Tue Apr 08, 2008 11:28 am

I am using the Zend framework with requires a Rewrite rule to send everything to index.php. Fine. I have that working. However, I also have a blog on my site which needs to have this redirect disabled. My current rewrite rule looks like:

RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css|pdf|swf|flv)$ /index.php
RewriteRule (feed|media|files).*(gif|jpg|png|pdf)$ /index.php

And I want to prevent rewrites from happening when I go to /documentroot/blog

How do I create this exception? I already tried

<Directory /documentroot/blog>
RewriteEngine off
<Directory>

and that breaks the original rewrite rule by creating a loop.

To make matters worse, my boss wants pretty URLs to work on the /blog subdirectory.

Any ideas?
bubbagump
 
Posts: 5
Joined: Tue May 22, 2007 9:49 am

Postby richardk » Wed Apr 09, 2008 1:44 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# Ignore /blog
Rewriterule ^blog(/.*)?$ - [L]

RewriteRule !\.(js|ico|gif|jpg|png|css|pdf|swf|flv)$ /index.php [QSA,L]
RewriteRule (feed|media|files).*(gif|jpg|png|pdf)$   /index.php [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Content

Who is online

Users browsing this forum: No registered users and 3 guests

cron