Home > Backend Development > PHP Tutorial > 求htaccess守则

求htaccess守则

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:02:20
Original
907 people have browsed it

求htaccess规则
除了 /admin 和 /use 目录都转跳 /new目录

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

RewriteEngine on
RewriteCond %{REQUEST_URI} !^(/admin
------解决方案--------------------
/user)
RewriteRule (.*) /new/$1
------解决方案--------------------
这种情况要考虑断言
(?!admin
------解决方案--------------------
user)
一般的非或与写出来 也许会违背初衷
------解决方案--------------------

<br />RewriteEngine on<br />RewriteBase /<br />RewriteCond $1 !^(admin\/(.*)<br><font color='#FF8000'>------解决方案--------------------</font><br>$)<br />RewriteCond $1 !^(user\/(.*)<br><font color='#FF8000'>------解决方案--------------------</font><br>$)<br />RewriteCond $1 !^(new\/(.*)<br><font color='#FF8000'>------解决方案--------------------</font><br>$)<br />RewriteRule ^(.*)$ new/$1 [L,QSA]<br />
Copy after login

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template