简体   繁体   English

.htaccess管理区的条件

[英].htaccess condition for admin area

i need to write condition for non admin area. 我需要为非管理员区域写条件。 Please, help me with syntax. 请帮我语法。

<FilesMatch ".(gif|jpg|png)$">
   RewriteEngine On
   RewriteCond %{REQUEST_FILENAME} -f
   RewriteRule ^(.*)$ /watermark/_watermark.php [T=application/x-httpd-php,L,QSA]
</FilesMatch>

for example - if url has no /admin/ substring - it should be true for script executing. 例如-如果url没有/ admin /子字符串-对于脚本执行,它应该为true。

Thanks, 谢谢,

Simply use that as your pattern for RewriteRule : 只需将其用作RewriteRule的模式:

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule !(^|/)admin/ /watermark/_watermark.php [T=application/x-httpd-php,L,QSA]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM