>  기사  >  백엔드 개발  >  win下的httpd.ini规则该如何样写更简洁,

win下的httpd.ini规则该如何样写更简洁,

WBOY
WBOY원래의
2016-06-13 11:49:001045검색

win下的httpd.ini规则该怎么样写更简洁,求助!

[ISAPI_Rewrite]<br /># Defend your computer from some worm attacks<br />#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]<br /># 3600 = 1 hour<br />CacheClockRate 3600<br />RepeatLimit 32<br /># Protect httpd.ini and httpd.parse.errors files<br /># from accessing through HTTP<br /># Rules to ensure that normal content gets through<br /><br />RewriteRule /tag/(.*) /index\.php\?tag=$1<br />RewriteRule /software-files/(.*) /software-files/$1 [L]<br />RewriteRule /images/(.*) /images/$1 [L]<br />RewriteRule /bbs/(.*) /bbs/$1 [L]<br />RewriteRule /sitemap.xml /sitemap.xml [L]<br />RewriteRule /robots.txt /robots.txt [L]<br />RewriteRule /503.php /503.php  [L]<br />RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]<br />RewriteRule /sitemap.xml.gz /sitemap.xml.gz [L]<br />RewriteRule /sitemap.html /sitemap.html [L]<br />RewriteRule /favicon.ico /favicon.ico [L]<br />RewriteRule /unzip.php /unzip.php [L]<br />RewriteRule /kefu.php /kefu.php [L]<br />RewriteRule /js/(.*) /js/$1 [L]<br />RewriteRule /css/(.*) /css/$1 [L]<br /># For file-based wordpress content (i.e. theme), admin, etc.<br />RewriteRule /wp-(.*) /wp-$1 [L]<br /># For normal wordpress content, via index.php<br />RewriteRule ^/$ /index.php [L]<br />RewriteRule /(.*) /index.php/$1 [L]<br />



我每在web目录下加一个文件 就得在RewriteRule多加一行 有什么办法可以通匹配所有的文件么 而不需要一个一个加 很麻烦
------解决方案--------------------
你试试在RepeatLimit 32的下面加

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

试试

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.