欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2022-03-29 17:33:23
...
win下的httpd.ini规则该怎么样写更简洁,求助!
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Rules to ensure that normal content gets through

RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
RewriteRule /bbs/(.*) /bbs/$1 [L]
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /robots.txt /robots.txt [L]
RewriteRule /503.php /503.php [L]
RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]
RewriteRule /sitemap.xml.gz /sitemap.xml.gz [L]
RewriteRule /sitemap.html /sitemap.html [L]
RewriteRule /favicon.ico /favicon.ico [L]
RewriteRule /unzip.php /unzip.php [L]
RewriteRule /kefu.php /kefu.php [L]
RewriteRule /js/(.*) /js/$1 [L]
RewriteRule /css/(.*) /css/$1 [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]



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

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

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

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频