1、禁止目錄腳本可執(zhí)行權(quán)限
需要去除App、Upload、Data、Public、Install這5個(gè)目錄的腳本執(zhí)行權(quán)限
創(chuàng)建apache偽靜態(tài)規(guī)則文件:.htaccess,內(nèi)容如下
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^.*(.css|.js|.gif|.png|.jpg|.jpeg|.bmp)$
#以下2中寫(xiě)法選擇其中一個(gè)
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
#RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
RewriteRule ^(.*)App/Tpl/(.+).html$ / [NC,F]
RewriteRule (App|Upload|Data|Public|Install)/(.*).(php)$ – [NC,F]
創(chuàng)建好后,通過(guò)FTP上傳到網(wǎng)站根目錄下即可
其中RewriteRule (App|Upload|Data|Public|Install)/(.*).(php)$ – [NC,F] 表示去除5個(gè)目錄的腳本可執(zhí)行權(quán)限
2、設(shè)置目錄權(quán)限
找到【讀寫(xiě)權(quán)限】并打開(kāi),將網(wǎng)站根目錄設(shè)置為只讀,然后將Data和Upload目錄設(shè)置為可讀寫(xiě)