Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess重定向到404页面,如果在url中的.php文件之后写入了任何内容_Php_.htaccess_Mod Rewrite_Url Rewriting - Fatal编程技术网

.htaccess重定向到404页面,如果在url中的.php文件之后写入了任何内容

.htaccess重定向到404页面,如果在url中的.php文件之后写入了任何内容,php,.htaccess,mod-rewrite,url-rewriting,Php,.htaccess,Mod Rewrite,Url Rewriting,这是我的网站网址http://www.example.com/about-us.php 如果有人试图打开http://www.example.com/about-us.php/about-us.php 它应该重定向到404错误页面,而不是显示没有正确css样式的相同页面。这只是一个例子,有更多类似的URL。有没有办法防止这些伪造的URL 提前感谢。您使用的是任何框架或CMS,还是它的php代码?以及.htaccess文件中的内容。您在.htaccess文件中做了什么吗?没有htaccess文件,

这是我的网站网址http://www.example.com/about-us.php 如果有人试图打开http://www.example.com/about-us.php/about-us.php 它应该重定向到404错误页面,而不是显示没有正确css样式的相同页面。这只是一个例子,有更多类似的URL。有没有办法防止这些伪造的URL


提前感谢。

您使用的是任何框架或CMS,还是它的php代码?以及.htaccess文件中的内容。您在.htaccess文件中做了什么吗?没有htaccess文件,它是核心php