[英]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.