Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.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 重定向301 HTACCES_Php_.htaccess_Redirect_Url Rewriting - Fatal编程技术网

Php 重定向301 HTACCES

Php 重定向301 HTACCES,php,.htaccess,redirect,url-rewriting,Php,.htaccess,Redirect,Url Rewriting,如何将页面从重定向到 我在另一页上用过,下面这个很好用 <IfModule mod_rewrite.c> Redirect 301 /page.html /newpage.html </IfModule> 您可以使用重写规则 RewriteEngine on #redirect /?page=page to /page.html RewriteCond %{THE_REQUEST} /en/\?page=informacje\s [NC] RewriteRule ^e

如何将页面从重定向到

我在另一页上用过,下面这个很好用

<IfModule mod_rewrite.c>
Redirect 301 /page.html /newpage.html
</IfModule> 

您可以使用
重写规则

RewriteEngine on
#redirect /?page=page to /page.html
RewriteCond %{THE_REQUEST} /en/\?page=informacje\s [NC]
RewriteRule ^en/?$ https://maripol.pl/en/informacje.html? [L,R,NE]

对不起,我是故意的。当我重写规则/?page=informacje^informacje\.html$[L,R,NE]时,它不起作用。@devil1321请立即尝试更新的版本。它不起作用。我需要改变一下https://maripol.pl/en/?page=informacje 对此https://maripol.pl/en/informacje.html. 我试图重写cond%{QUERY_STRING}id=3重写规则^en/informacje\.php$/en/informacje.html/?[L,R=301]但它也不起作用。@devil1321我根据您的评论更新了代码。请在清除浏览器缓存后对其进行测试。好的,很抱歉无法正常工作。我想我需要添加^en/?$。谢谢
<IfModule mod_rewrite.c>
Redirect 301 https://www.domain.eu/page.html  https://www.domain.eu/?page=page
</IfModule>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]




RewriteCond %{HTTP_HOST} https://www.maripol.pl/en/ [NC]
RewriteRule ^(.*)$ https://maripol.pl/en/$1 [L,R=301]

RewriteRule ^index.html$ https://maripol.pl/en [R=301,L]
RewriteRule ^index.php$ https://maripol.pl/en [R=301,L]
RewriteRule ^(.*),more.html$ index.php?page=more&id=$1 [NC,L]
RewriteRule ^(.*),pogodzinach.html$ index.php?page=pogodzinach&id=$1 [NC,L]
RewriteRule ^(.*),(.*).html$ index.php?page=oferta&id=$1&url=$2 [NC,L]
RewriteRule ^(.+)\.html$ ?page=$1 [NC,L]



RewriteCond %{THE_REQUEST} /en/\?page=informacje\s [NC]
RewriteRule ^en/?$ https://maripol.pl/en/informacje.html? [L,R,NE]
RewriteEngine on
#redirect /?page=page to /page.html
RewriteCond %{THE_REQUEST} /en/\?page=informacje\s [NC]
RewriteRule ^en/?$ https://maripol.pl/en/informacje.html? [L,R,NE]