Htaccess mod rewrite NOT

I have a little problem rewriting url on apache.

I would like it to ignore the administration / folder when overwriting.

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

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

Thank.

+3
source share
2 answers

You can use RewriteCond to set conditions on RewriteRule. If all conditions do not match, the RewriteRule will not apply. In your case, I assume that your admin folder is in http://yoursite.com/admin, so this rule should work:

RewriteCond %{REQUEST_URI} !^/admin/*

RewriteRule, . RewriteCond RewriteRule , , .

+1

, ServerFault, :

RewriteRule ^admin/ - [L]

, URL- URL-, admin/.

0

Source: https://habr.com/ru/post/1741729/


All Articles