我有 2 个附加域,我想将它们用作主域的别名。我的 htaccess 中有这个设置,但它不是 100% 正确的。每当我从两个域之一访问页面时,它总是重定向到主域索引页面。
例如,当它需要重定向到https://www.bumpstudios.co.uk/downloads时,去https://bumpstudios.com/downloads会重定向到https://www.bumpstudios.co.uk/
这是我的 htacess 文件
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule .* https://www.bumpstudios.co.uk%{REQUEST_URI} [R,L]
RewriteBase /
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{HTTP_HOST} ^bumpstudios.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.bumpstudios.com$ [OR]
RewriteCond %{HTTP_HOST} ^bumpstudios.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.bumpstudios.uk$ [OR]
RewriteCond %{HTTP_HOST} ^bumpstudios.co.uk$
RewriteRule (.*)$ https://www.bumpstudios.co.uk/{REQUEST_URI} [R=301,L]
</IfModule>