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
Apache htaccessrewritecond&;重写规则_Apache_.htaccess_Mod Rewrite_Url Rewriting - Fatal编程技术网

Apache htaccessrewritecond&;重写规则

Apache htaccessrewritecond&;重写规则,apache,.htaccess,mod-rewrite,url-rewriting,Apache,.htaccess,Mod Rewrite,Url Rewriting,我把我头发上剩下的大部分都拔了出来,我觉得答案很简单 我有一个网址: {此处为查询字符串的其余部分} 我想把它改写成 {此处为查询字符串的其余部分} 用户不需要重定向。但我无法理解这一点。我尝试了50或60种不同的方法,我希望有人能帮助我 您是否简单地尝试过: DirectoryIndex index.php 在文档根目录的htaccess文件中 或者尝试: RewriteEngine On RewriteCond %{QUERY_STRING} ^download= RewriteRule

我把我头发上剩下的大部分都拔了出来,我觉得答案很简单

我有一个网址:

{此处为查询字符串的其余部分}

我想把它改写成

{此处为查询字符串的其余部分}

用户不需要重定向。但我无法理解这一点。我尝试了50或60种不同的方法,我希望有人能帮助我

您是否简单地尝试过:

DirectoryIndex index.php
在文档根目录的htaccess文件中

或者尝试:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^download=
RewriteRule ^$ /index.php [L]
您是否简单地尝试过:

DirectoryIndex index.php
在文档根目录的htaccess文件中

或者尝试:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^download=
RewriteRule ^$ /index.php [L]

实际上,我之所以需要它是因为在这个根中,我需要index.html作为默认值。但是因为这是WordPress,所以当调用.Hi Jon时,我需要将index.php“注入”到两个URL中。在本网站上,您的编辑工作正常:但是,当在标准WordPress编辑的htaccess文件中使用时,URL不会被重写。@Russ您是否将该规则置于任何WordPress规则之前?之前和之后,是的:(尽管如此,我还是非常感谢您的帮助。实际上,我之所以需要它,是因为在这个根目录中,我需要index.html作为默认值。但是因为这是WordPress,我需要“注入”调用index.php时将其转换为两个URL。嗨,Jon。在本网站上,您的编辑工作正常:但是,当在标准WordPress编辑的htaccess文件中使用时,URL不会被重写。@Russ您是否将该规则置于任何WordPress规则之前?之前和之后,是的:(我非常感谢您的帮助)。