繁体   English   中英

重定向 301 HTACCES

[英]Redirect 301 HTACCES

如何将页面从https://url.pl?page=page重定向到https://url.eu/page.html

我在其他页面上使用过,下面的作品

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

但是当我在下面使用一次时它不起作用

<IfModule mod_rewrite.c>
Redirect 301 /page.html /?page=page
</IfModule> 
<IfModule mod_rewrite.c>
Redirect 301 https://www.domain.eu/page.html  https://www.domain.eu/?page=page
</IfModule>

我也使用了 RewriteRule 但它也不起作用

htacess 文件

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]

您可以使用RewriteRule

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]

暂无
暂无

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

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