2014-01-19 57 views

回答

0

將這個代碼在你DOCUMENT_ROOT/.htaccess文件:

RewriteEngine On 

# If IP is not 192.168.1.200 
RewriteCond %{REMOTE_ADDR} !^192\.168\.1\.200$ 
# block access to all .php files 
RewriteRule \.php$ - [F,NC] 
0

試試這個:

<FilesMatch "\.(php)$"> 
    Order allow,deny 
    Deny from all 
    Allow from 192.168.1.200 
</Files> 

它匹配所有的PHP文件,並只允許specifie d ip。你應該考慮添加一個403錯誤處理程序

相關問題