Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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 清除URL htaccess-(?p=1)_.htaccess_Url - Fatal编程技术网

.htaccess 清除URL htaccess-(?p=1)

.htaccess 清除URL htaccess-(?p=1),.htaccess,url,.htaccess,Url,如何使用htaccess文件重写url 所以它看起来是这样的: 尝试添加以下内容: RewriteEngine On RewriteRule ^/?index.php$ http://www.example.com/? [L,R=301] 感谢您的快速回复!我有几个页面,12页是正确的:)url以?p=1,?p=2,?p=3,?p=4结尾,…我希望最后一个问题:)所以如果我想在所有站点上创建“干净的url”,我只需写以下内容:RewriteRule^/?index.php$上的RewriteE

如何使用htaccess文件重写url 所以它看起来是这样的: 尝试添加以下内容:

RewriteEngine On
RewriteRule ^/?index.php$ http://www.example.com/? [L,R=301]

感谢您的快速回复!我有几个页面,12页是正确的:)url以?p=1,?p=2,?p=3,?p=4结尾,…我希望最后一个问题:)所以如果我想在所有站点上创建“干净的url”,我只需写以下内容:RewriteRule^/?index.php$上的RewriteEngine?[L,R=301]重写规则^/?gallery.php$?[L,R=301]重写规则^/?contact.php$?[L,R=301]@KatiaGavrilov是的,这会奏效。如果你有很多URL,你可以看一些更通用的。让我知道