想要重定向网址

时间:2018-03-07 03:33:16

标签: .htaccess

我想从

重定向所有网址

https://englishact.com/jumblesolver/?zig=(。*)

https://englishact.com/jumblesolver/jumblesolver.php?zig= $ 1

这是我正在尝试的htaccess代码

RewriteRule    ^jumblesolver/?zig=(.*)$    jumblesolver/jumblesolver.php?zig=$1    [R=301,NC,L]

但代码没有执行。 证明: 如果你去

https://englishact.com/jumblesolver/?zig=tagalog

https://englishact.com/jumblesolver/jumblesolver.php?zig=tagalog

您会看到不同的结果。我希望两个结果都像

一样

https://englishact.com/jumblesolver/jumblesolver.php?zig=tagalog

1 个答案:

答案 0 :(得分:1)

将代码添加到您的顶部 jumble solver  页

<?php
if(isset($_GET['zig'])){
   $url = "https://englishact.com/jumblesolver/jumblesolver.php?zig=".urlencode($_GET['zig']);
  header('Location: '.$url );

}
?>