Web services 阻止访问主域上子域的文件夹

Web services 阻止访问主域上子域的文件夹,web-services,.htaccess,cpanel,Web Services,.htaccess,Cpanel,我的主机上几乎没有网站。他们大多数都有自己的领域 我想阻止通过maindomain.com/subdomain访问我的子域文件夹 我想让它只能通过subdomain.maindomain.com打开 如果可能,请禁用访问,或者将其重定向到子域。htaccess: RewriteEngine on RewriteBase / #if not already blog.website.com RewriteCond %{HTTP_HOST} !^blog\.website\.com$ [NC]

我的主机上几乎没有网站。他们大多数都有自己的领域

我想阻止通过maindomain.com/subdomain访问我的子域文件夹

我想让它只能通过subdomain.maindomain.com打开

如果可能,请禁用访问,或者将其重定向到子域。

htaccess:

RewriteEngine on
RewriteBase / 

#if not already blog.website.com
RewriteCond %{HTTP_HOST} !^blog\.website\.com$ [NC] 
#if request is for blog/, go to blog.website.com
RewriteRule ^blog/$ http://blog.website.com [L,NC,R=301]
RedirectMatch ^/subdomain/(.*)$ http://subdomain.mysite.com/$1
htaccess:

RedirectMatch ^/subdomain/(.*)$ http://subdomain.mysite.com/$1

Codeigniter有自己的重写系统,你们可能会有冲突。Codeigniter有自己的重写系统,你们可能会有冲突。