简体   繁体   English

htaccess,从旧页面重定向到新页面(php和post变量)

[英]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 ? 我的问题是,如何通过htaccess将旧页面正确重定向到新页面?

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 : 在我的htaccess中,这一功能非常完美,所以我不明白:

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 => 目前,没有找到任何基于htaccess的解决方案,我在索引页面中使用php if条件=>

<?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");
}

?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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