我的网站有document ~/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非常感谢你的帮助。谢谢。
发布于 2015-10-22 14:34:02
您的.htaccess文件应该有
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^subdomain.domain.in [NC]
RewriteRule ^(.*)$ http://www.hardikvyas.in/$1 [L,R=301]
RedirectMatch ^/$ /redirection directory name/尝尝这个。
https://stackoverflow.com/questions/33277100
复制相似问题