求htaccess规则

WBOY
Release: 2016-06-23 13:53:43
Original
731 people have browsed it

除了 /admin 和 /use 目录都转跳 /new目录

RewriteRule ^([^\/admin\/(.*)])|^([^\/user\/(.*)]) /new/$1
这个哪错了


回复讨论(解决方案)


RewriteEngine on
RewriteCond %{REQUEST_URI} !^(/admin|/user)
RewriteRule (.*) /new/$1

RewriteEngine on
RewriteCond %{REQUEST_URI} !^(/admin|/user)
RewriteRule (.*) /new/$1


500错误

这种情况要考虑断言
(?!admin|user)
一般的非或与写出来 也许会违背初衷

RewriteEngine onRewriteBase /RewriteCond $1 !^(admin\/(.*)|$)RewriteCond $1 !^(user\/(.*)|$)RewriteCond $1 !^(new\/(.*)|$)RewriteRule ^(.*)$ new/$1 [L,QSA]
Copy after login

这种情况要考虑断言
(?!admin|user)
一般的非或与写出来 也许会违背初衷




应当考虑不然不违背原始意图
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!