Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 指向主域的子域_.htaccess_Mod Rewrite - Fatal编程技术网

.htaccess 指向主域的子域

.htaccess 指向主域的子域,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,我添加了一个子域:support.mysite.com 支持目录位于根目录中。现在,每当我尝试访问子域时,就会被重定向到主域的index.php文件 例如,我尝试访问support.mysite.com/index.php,最后访问mysite.com/index.php 我猜这与主域的htaccess文件有关,即: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www.(.)$ [NC] RewriteRule ^(.)$ h

我添加了一个子域:support.mysite.com

支持目录位于根目录中。现在,每当我尝试访问子域时,就会被重定向到主域的index.php文件

例如,我尝试访问support.mysite.com/index.php,最后访问mysite.com/index.php

我猜这与主域的htaccess文件有关,即:

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

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]
子域还没有htaccess文件


任何帮助都将不胜感激

尝试注释内容,直到它停止重定向您。在主域的
DocumentRoot
下是否有一个名为
/support/
的真实目录。我已通过cPanel创建了一个子域。我的文档根目录包含(除常用目录和文件外)支持目录和公共html目录。支持子目录中是否有.htaccess?不,支持子目录中没有htaccess。在主目录中,只有上面的htaccess。