Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.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
Php HTACCESS Don';t使用参数重定向_Php_Apache_.htaccess - Fatal编程技术网

Php HTACCESS Don';t使用参数重定向

Php HTACCESS Don';t使用参数重定向,php,apache,.htaccess,Php,Apache,.htaccess,我得到了这行代码: RewriteRule artistprofile.php rewrite.php?$1 [R=301,L] 但是重定向没有相应地起作用 被重定向到 我期待着 请帮忙 您没有首先捕获使用$1的查询 试试这个 您必须使用,如下所示: RewriteRule artistprofile.php rewrite.php [R=301,L,QSA] 现在,URLhttp://domain.com/artistprofile.php?displayname=bryan+黄将被重定

我得到了这行代码:

RewriteRule artistprofile.php rewrite.php?$1 [R=301,L]
但是重定向没有相应地起作用

被重定向到

我期待着


请帮忙

您没有首先捕获使用$1的查询 试试这个

您必须使用,如下所示:

RewriteRule artistprofile.php rewrite.php [R=301,L,QSA]
现在,URL
http://domain.com/artistprofile.php?displayname=bryan+黄
将被重定向到
http://domain.com/rewrite.php?displayname=bryan+黄

RewriteRule artistprofile.php rewrite.php [R=301,L,QSA]