Home > Backend Development > PHP Tutorial > php rewritrule

php rewritrule

WBOY
Release: 2016-06-06 20:23:50
Original
1263 people have browsed it

<code>RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]</code>
Copy after login
Copy after login

我的htaccess这样,怎么修改才能使某个目录下的文件不定性到index.php

回复内容:

<code>RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]</code>
Copy after login
Copy after login

我的htaccess这样,怎么修改才能使某个目录下的文件不定性到index.php

没有方式吧,apache的alias这个可以替代下

  1. 例子 排除 images css js目录
    RewriteCond $1 !^(images|css|js)

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

Related labels:
php
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