[英]only main Subdomain redirect to main domain through .htaccess
我只想將主要子域(例如http://dl.domain.com)重定向到domain.com
但不能將文件或腳本鏈接重定向到主域。
http://dl.domain.com/123.zip http://dl.domain.com/zippy.zip等
如何使用.htaccess規則執行此操作?
我使用這些.htaccess規則,但問題無法解決
RewriteCond %{HTTP_HOST} ^(www\.)?subdomain\.domain\.com$ [NC]
RewriteRule !^xyz\.php($|/) http://www.domain.com%{REQUEST_URI} [NE,R=301,L]
您可以使用:
RewriteCond %{HTTP_HOST} ^(www\.)?subdomain\.domain\.com$ [NC]
RewriteRule ^/?$ http://www.domain.com [R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.