我在JustHost上有一个托管帐户,我的主域是zdental.co,我有附加域zinapi.com,我使用以下代码限制从主域(zinapi.zdental.ca)访问我的子域:
RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^zinapi.zdental.co$ [OR]
RewriteCond %{HTTP_HOST} ^www.zinapi.zdental.co$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ - [L,R=404]
当我转到url zinapi.zdental.co(显示未找到的页面)时,它工作得很好,但当我直接转到zinapi.z dental.co/temp/时,这不起作用,有人能帮我吗?
在zinapi.zdental.co
:的根.htaccess
中尝试此规则
RewriteEngine On
SetEnvIf Host ^ suppress-error-charset
ErrorDocument 404 "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'></head><body>No se encontró la página que buscas, intenta ingresando a nuestra página principal</body></html>"
RewriteCond %{HTTP_HOST} ^(www.)?zinapi.zdental.co$ [NC]
RewriteRule ^ - [L,R=404]