需求:
六個文件的入口,其他都重定向到index
自己的思路:
正則找出不是六個文件的URL的模式,進(jìn)行過濾。
對比同事的結(jié)果,自己思路的問題:
1. 想找出所有不符合規(guī)則的,越想越多,無法下手。---------------- 思路錯誤,應(yīng)該 制定白名單,
2. 概念錯誤, 弄錯 REQUEST_URI 和 REQUEST_STRING 的概念 基礎(chǔ)知識不牢固。
最后結(jié)果:
復(fù)制代碼 代碼如下:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/(.*) /index.asp$1 [L]
RewriteCond %{REQUEST_URI} ^/index.asp [NC,OR]
RewriteCond %{REQUEST_URI} ^/o.asp [NC,OR]
RewriteCond %{REQUEST_URI} ^/s.asp [NC,OR]
RewriteCond %{REQUEST_URI} ^/error.asp [NC,OR]
RewriteCond %{REQUEST_URI} ^/favicon.ico [NC,OR]
RewriteCond %{REQUEST_URI} ^/status.taobao [NC,OR]
RewriteCond %{REQUEST_URI} ^/app/thirdparty/webbox.asp [NC,OR]
RewriteCond %{REQUEST_URI} ^/static/ [NC]
RewriteRule ^.* - [L]
RewriteCond %{REQUEST_URI} !^/index.asp$
RewriteRule ^.*
主站蜘蛛池模板:
阿城市|
延津县|
石阡县|
东明县|
鄂尔多斯市|
江西省|
贡觉县|
徐闻县|
临潭县|
海门市|
遂溪县|
桐柏县|
古丈县|
望城县|
新乡县|
新干县|
尼勒克县|
高碑店市|
阿勒泰市|
鄂伦春自治旗|
东丰县|
阿合奇县|
湘阴县|
前郭尔|
新闻|
丰县|
临湘市|
仙桃市|
白朗县|
承德市|
红安县|
柞水县|
大荔县|
宝兴县|
奉节县|
沙湾县|
昌平区|
新河县|
绥芬河市|
肥西县|
太康县|