分享

写回答

发帖

[提问] 如何通过HTACCESS让gd非win虚拟主机不区分大小写呀!

GoDaddy GoDaddy 1132 人阅读 | 2 人回复

发表于 2010-11-25 21:14:44 | 显示全部楼层 |阅读模式

老鸟们,麻烦你们了
如何通过HTACCESS让gd非win虚拟主机不区分大小写呀!
万分感谢了!

回答|共 2 个

goldstein

发表于 2010-11-25 21:40:27 | 显示全部楼层

Check it out:
  1. Example:
  2. Request for /FOO/BAR.htm should return file contents of /foo/bar.htm, but gets stuck in a loop and time's out instead.

  3. The commands I'm using in my .htaccess

  4. # If the uri does not contain any uppercase letters, skip the next 29 rules.
  5. RewriteRule ![A-Z] - [S=29]

  6. # Skip rewriting for certain files, skip the next 28 rules
  7. RewriteRule .*(cgi-bin|images|\.gif|\.css|\.jpg|\.png|\.js) - [NC,S=28]

  8. # Else convert the first instance found of "A" to "a", "B" to "b", etc.
  9. RewriteRule ([^A]*)A(.*) $1a$2
  10. RewriteRule ([^B]*)B(.*) $1b$2
  11. ...repeated for C-X
  12. RewriteRule ([^Y]*)Y(.*) $1y$2
  13. RewriteRule ([^Z]*)Z(.*) $1z$2

  14. # If any more uppercase characters remain, restart mod_rewrite from the top
  15. RewriteRule [A-Z] - [N]  

  16. # Otherwise rewrite file
  17. RewriteRule ^/(.*)$ /$1 [L,NS]
复制代码
RAKSmart

7kbb

发表于 2010-11-26 00:19:51 | 显示全部楼层

回复 2# 的帖子

If the uri does not contain any uppercase letters, skip the next 29 rules  
URL里面不含有任何大写字母就跳过下面第29条规则。这里是不是指的是用IP访问的网站地址呀
RAKSmart
您需要登录后才可以回帖 登录 | 注册

本版积分规则