簡體   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