我在PHP中遇到了URL路由问题。
在我的本地主机上,我有两个项目目录:
1. project_one: - index.php - 其他目录
2. hacking_script: - index.php - database_dump.php 当我想要访问project_one时,我会使用'localhost/project_one',这样是正确的。但是,当我输入'localhost/project_one/../../hacking_script'时,它会打开'localhost/hacking_script/index.php'文件。
我不知道该如何防止这种情况发生。我能否使用.htaccess来防止?如果可以,那怎么做?
在我的本地主机上,我有两个项目目录:
1. project_one: - index.php - 其他目录
2. hacking_script: - index.php - database_dump.php 当我想要访问project_one时,我会使用'localhost/project_one',这样是正确的。但是,当我输入'localhost/project_one/../../hacking_script'时,它会打开'localhost/hacking_script/index.php'文件。
我不知道该如何防止这种情况发生。我能否使用.htaccess来防止?如果可以,那怎么做?
localhost/project_one/../../hacking_script
时,它会重定向到localhost/hacking_script/
而不是进入我的project_one
的 index.php 文件。 - Himanshu.htaccess
е’Ңindex.php
жҲ–и·Ҝз”ұи„ҡжң¬гҖӮ - Praveen Kumar Purushothamanindex.php
文件,并且在这个项目中我没有使用.htaccess
。 - Himanshu