Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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_Redirect - Fatal编程技术网

使用.htaccess永久重定向此url

使用.htaccess永久重定向此url,.htaccess,redirect,.htaccess,Redirect,我试图永久重定向一个url,但它似乎不起作用,这是我在.htaccess文件中的内容 RewriteEngine on rewriteRule ^modules\.php?name=My_Page$ http://mysite.net/mypage [R=permanent,L] 如您所见,我想将modules.php?name=My_页面重定向到 谢谢你的帮助。谢谢重写规则中使用的路径不包含查询字符串。使用 RewriteEngine on RewriteBase / RewriteCon

我试图永久重定向一个url,但它似乎不起作用,这是我在.htaccess文件中的内容

RewriteEngine on
rewriteRule ^modules\.php?name=My_Page$ http://mysite.net/mypage [R=permanent,L]
如您所见,我想将modules.php?name=My_页面重定向到
谢谢你的帮助。谢谢

重写规则中使用的路径不包含查询字符串。使用

RewriteEngine on
RewriteBase /

RewriteCond %{QUERY_STRING} ^name=My_Page$
rewriteRule ^modules\.php$ /mypage? [R=permanent,L]

重写规则中使用的路径不包含查询字符串。使用

RewriteEngine on
RewriteBase /

RewriteCond %{QUERY_STRING} ^name=My_Page$
rewriteRule ^modules\.php$ /mypage? [R=permanent,L]

很好!非常感谢。我的一些重定向URL附带了?name=my_页面。我能做些什么来摆脱这些?见上面的编辑。只需添加一个
和替换url的结尾。效果很好!非常感谢。我的一些重定向URL附带了?name=my_页面。我能做些什么来摆脱这些?见上面的编辑。只需添加一个
和替换url的结尾。