我使用WordPress,希望将所有不存在的子域(或所有子域)重定向到主域。
Examples of urls to be redirected:
subdomains.example.com
subdomains.example.com/xxx
subdomains.example.com/xxx.html
subdomains.example.com/t/xxx.php
TO
www.example.com
.htaccces
主域的(我正在编辑此)。不存在子域的任何文件夹或文件都不存在。# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress