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

丁崽 2014-02-02 11:08:19
[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多加一行 有什么办法可以通匹配所有的文件么 而不需要一个一个加 很麻烦
...全文
141 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
longxuu 2014-02-07
  • 打赏
  • 举报
回复
你试试在RepeatLimit 32的下面加 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d 试试

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧