This is the path which i have secure details say for eg., http://localhost/application/secure_details
secure_details
is the folder where my confidential files get uploaded.
The Third Person who knows the above URL can able to get the particular details,
This not should be allowed. i need to redirect to error_page
if the person is directly accessing this particular URL.
问问题
810 次
2 回答
0
使用mod_rewrite
,将其添加到您的根目录.htaccess
:
RewriteEngine on
RewriteBase /
RewriteRule ^application/secure_details/?.*?$ /error.html [L,R=301]
此外,将此.htaccess
文件添加到secure_details
目录中:
Deny from all
于 2013-08-26T11:17:08.023 回答
0
首先,您需要在 apache 中启用重写模块以使用htaccess
. 之后,您可以使用以下脚本保护您的网址
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^/*application/secure_details error.php[L,NC,QSA]
在error.php
文件中,您可以编写错误消息
于 2013-08-26T11:18:48.407 回答