简体   繁体   中英

htaccess, redirect from old page to new page (php and post variable)

My question is, how to redirect correctly by htaccess my old page to my new page ?

I tried that but without success :

RewriteRule ^index\.php?page=wallrank-top10-1&requete=keyword&searchkeyword=crac$ http://serveurs.top-minecraft.fr/index.php?keyword=crack$1 [R=302,L]

In my htaccess this one work perfectly so I don't understand :

RewriteRule ^portail\.html$ http://www.top-minecraft.fr/portal.php [L]

Someone can help me ?

这将足以使用参数进行重定向

RewriteRule ^index.php$ http://serveurs.top-minecraft.fr/index.php [R=302,L]

for the moment, without find any solution based into htaccess, I use an php if condition in my index page =>

<?php

$requeteurl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

if ($requeteurl == 'http://serveurs.top-minecraft.fr/index.php?keyword=crack') {
Header("HTTP/1.1 301 Moved Permanently");
Header("Location: http://serveurs.top-minecraft.fr/index.php?page=wallrank-top10-1&requete=keyword&searchkeyword=crac");
}

?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM