daydreamer
daydreamer

Reputation: 153

Mod Rewrite Confusion

I have a site that uses Mod_Rewrite rules. I am no expert and had to ask this question here. I have a rule in my .htaccess:

RewriteRule ^(.*)/$ /inner.php?pagename=$1 [QSA,L]

So on the site i calls the database based on the variable in the URL. But i added a wordpress blog on the site and it does not work.

The blog url is www.site.com/blog/ but it does not work if that rule is active. If i remove the rule it works fine. Is there a way to exclude /blog/ from this rule?

Upvotes: 1

Views: 46

Answers (1)

jman
jman

Reputation: 11606

Add these lines before the rule. They prevent the rule from taking effect if a file or directory exist that match the URL:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Upvotes: 1

Related Questions