|
|
优点:可以让用户只能访问HTML页面,除了服务器安全外无优!此方法不限于DEDE,其它CMS只想静态化也可以使用
缺点:无法使用自带搜索,想搜索的话只有自己可以添加第三方搜索了
环境:LNMP 0.9
- location ~ ^/(include|plus|data|后台等不想让用户访问的目录)/ {
- allow 允许访问的IP;
- deny all;
- index index.php index.html index.htm;
- location ~ .*\.(php|php5)?$ {
- try_files $uri =404;
- fastcgi_pass unix:/tmp/php-cgi.sock;
- fastcgi_index index.php;
- include fcgi.conf;
- }
- }
复制代码
效果:非允许的IP访问限制的目录403
没有独立IP怎么办?
可以用一些非常低价的有独立IP的VPS搭一个扶墙就可以了
|
|