apache rewrite規(guī)則實(shí)現(xiàn)白名單
需求:
六個(gè)文件的入口,其他都重定向到index
自己的思路:
正則找出不是六個(gè)文件的URL的模式,進(jìn)行過(guò)濾。
對(duì)比同事的結(jié)果,自己思路的問(wèn)題:
1. 想找出所有不符合規(guī)則的,越想越多,無(wú)法下手。---------------- 思路錯(cuò)誤,應(yīng)該 制定白名單,
2. 概念錯(cuò)誤, 弄錯(cuò) REQUEST_URI 和 REQUEST_STRING 的概念 基礎(chǔ)知識(shí)不牢固。
最后結(jié)果:
<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 ^.* – [F,L]
</IfModule>
相關(guān)文章
linux為repo 'AppStream'下載元數(shù)據(jù)失敗的解決
這篇文章主要介紹了linux為repo 'AppStream'下載元數(shù)據(jù)失敗的解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-06-06

linux Jenkins配置salve節(jié)點(diǎn)實(shí)現(xiàn)過(guò)程圖解

實(shí)現(xiàn)一臺(tái)或者多臺(tái)Linux實(shí)例解綁SSH密鑰對(duì)

ubuntu中編寫(xiě)shell腳本開(kāi)機(jī)自動(dòng)啟動(dòng)(推薦)