繁体   English   中英

使用htaccess的多个域名/子域名

[英]Miltiple domain/subdomain using htaccess

我的网站的文档根目录为〜/ public_html,我正在尝试使用htaccess组织多域/子域重定向。

可能的重定向逻辑:如果找到域/子域目录-执行重定向,否则引发404错误。

可能的目录结构:

public_html/
            .htaccess (main redirect router)
public_html/
            domain-1/
                    application/
                    public_html/
                                .htaccess
public_html/
            domain-2/
                    application/
                    public_html/
                                .htaccess
public_html/
            domain-3/
                    application/
                    public_html/
                                .htaccess
public_html/
            subdomain-1.domain-1/
                                application/
                                public_html/
                                            .htaccess
public_html/
            subdomain-2.domain-1/
                                application/
                                public_html/
                                            .htaccess

非常感谢您的帮助。 谢谢。

您的.htaccess文件应具有

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^subdomain.domain.in [NC]
RewriteRule ^(.*)$ http://www.hardikvyas.in/$1 [L,R=301]

RedirectMatch ^/$ /redirection directory name/

尝试这个。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM