我的bluehost带有通配符SSL证书,我在访问子域中的文件夹时遇到问题。 bv-site位于名为bv-site /的子文件夹中,当我转到https://bv-site.kavablue.com/js时,例如它显示顶级文件夹的内容?帮助将是惊人的,Bluhost需要两个.htaccess文件一个在顶层,一个在子域文件夹下面是文件。
#top level folder .htaccess file
# boatvibes site
#.htaccess WildCard SSL
RewriteEngine On
RewriteCond %{HTTP_HOST} ^bv-site.kavablue.com$
RewriteCond %{REQUEST_URI} !^/bv-site/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /bv-site/$1
RewriteCond %{HTTP_HOST} ^bv-site.kavablue.com$
RewriteRule ^(/)?$ bv-site/index.html [L]
#file in /bv-site
RewriteEngine on
RewriteCond %{HTTP_HOST} ^kavablue\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.kavablue\.com$
RewriteRule ^/?$ "https\:\/\/bv-site\.kavablue\.com\/" [R=301,L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
#RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.html [L]
</IfModule>
#options
#RewriteCond %{HTTP:Accept-Language} ^.*(de|es|fr|it|ja|ru|en).*$ [NC]
#RewriteRule ^(.*)$ - [env=prefer-language:%1]
答案 0 :(得分:0)
不应该这一行:
RewriteCond %{REQUEST_URI} !^/bv/
是:
RewriteCond %{REQUEST_URI} !^/bv-site/