簡體   English   中英

htaccess通配符重定向,異常

[英]htaccess wildcard redirect with an exception

我目前正在使用以下重定向規則。

RewriteEngine On

RewriteCond %{HTTP_HOST} ^domainexample.co.uk [OR]

RewriteCond %{HTTP_HOST} ^www.domainexmaple.co.uk

RewriteRule ^(.*)$ https://domainexamplenew.com/$1

我想在其中添加一個例外。對於GSC html驗證文件,例如googlee08e8ab5c95d7b8d.html-只是無法正常工作

任何幫助/建議表示贊賞,

約翰

好像您在重定向中存在無限循環。

您應在條件和規則中使用相同的域名。

現在,當用戶在domainexamplenew.com上打開頁面時,它將一次又一次地重定向到domainexamplenew.com。

如果要從domainexamplenew.co.uk重定向到domainexamplenew.com,則應更改條件的域。

例如

RewriteEngine On

RewriteCond %{HTTP_HOST} ^domainexample.com [OR]

RewriteCond %{HTTP_HOST} ^www.domainexmaple.com

RewriteRule ^(.*)$ https://domainexamplenew.com/$1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM