Apache 如何使用htaccess重定向到子域
我想使用Apache 如何使用htaccess重定向到子域,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我想使用.htaccess在网站上使用子域,但对.htaccess几乎没有经验。我的.htaccess文件中有以下内容,但不起作用: 这其中大部分是我从别人的建议中抄来的。我想要的是进入Family.mysitehere.org并让它进入mysitehere.org/Family 谁能告诉我这个代码有什么问题吗?非常感谢 DirectoryIndex index.html index.htm index.php AddHandler cgi-script .cgi .pl Options +
.htaccess
在网站上使用子域,但对.htaccess几乎没有经验。我的.htaccess
文件中有以下内容,但不起作用:
这其中大部分是我从别人的建议中抄来的。我想要的是进入Family.mysitehere.org并让它进入mysitehere.org/Family
谁能告诉我这个代码有什么问题吗?非常感谢
DirectoryIndex index.html index.htm index.php
AddHandler cgi-script .cgi .pl
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule wmail$ http://webmail.x7hosting.com [R,NC]
RewriteCond %{HTTP_HOST} \.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([^.]+)\.mysitehere\.org(:80)?<>/([^/]*) [NC]
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
RewriteRule ^(.*) /%1/$1 [L]
ErrorDocument 404 /404missing.php
DirectoryIndex.html index.htm index.php
AddHandler cgi script.cgi.pl
选项+FollowSymLinks
重新启动发动机
重写基/
重写规则wmail$http://webmail.x7hosting.com [R,NC]
重写cond%{HTTP_HOST}\。
重写cond%{HTTP_HOST}^www\。[北卡罗来纳州]
重写cond%{HTTP\u HOST}%{REQUEST\u URI}^([^.]+)\.mysitehere\.org(:80)?/([^/]*)[NC]
重写秒%1%3^(.*)\1$[NC]
重写规则^(.*)/%1/$1[L]
ErrorDocument 404/404missing.php
我想要的是进入Family.mysitehere.org并让它进入mysitehere.org/Family
在文档\u ROOT/.htaccess
文件中使用此代码:
RewriteEngine On
#RewriteCond %{HTTP_HOST} ^(Family)\.(mysitehere\.org)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L,NE]