views:

34

answers:

2

Hi, I have a small problem with url rewriting on apache.

I would like it that it ignores the admin/ folder from rewriting.

 Options +FollowSymLinks
 RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?cat=$1&name=$2 [L]
 RewriteRule ^([^/]*)/$ /index.php?cat=$1 [L]

I have triend doing it myself but I can't figure it out.

Thanks.

A: 

I think this may be more of a ServerFault thing, but there's a really quick answer: if you put

RewriteRule ^admin/ - [L]

before your other rewriting rules, that should prevent any URL transformations from being applied to URLs starting with admin/.

David Zaslavsky
A: 

You can use RewriteCond to put conditions on a RewriteRule. Unless all of the conditions match, the RewriteRule won't be applied. In your case, I'll assume your admin folder is located at http://yoursite.com/admin, so a rule like this should work:

RewriteCond %{REQUEST_URI} !^/admin/*

Put that before the RewriteRule that you want to prevent from being applied. The order of RewriteCond and RewriteRule directives is important, so be sure of where you're putting it.

zombat