我有一个 .htaccess 问题。基本上我的 .htaccess 将我新创建的子域重定向到主站点,我不希望它这样做。假设我的域名为“www.beans.com”,子域为“shop.beans.com”,public_html
位于/shop/
. 这是.htaccess:
DirectoryIndex index.php enmain.php
ErrorDocument 404 /404.html
## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType image/ico "access plus 1 year"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType text/x-javascript "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType text/xml "access plus 2 hours"
ExpiresDefault "access plus 1 hour"
## EXPIRES CACHING ##
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.beans.com$ [NC]
RewriteRule ^(.*)$ http://www.beans.com/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php)$ http://www.beans.com/$1 [R=301,L]
# Start CloudFlare:beans.com rewrite. Do not Edit
RewriteEngine On
RewriteCond %{HTTP_HOST} ^beans.com
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# End CloudFlare rewrite.
所以总而言之,我希望当我浏览到“shop.beans.com”时不要被重定向到“www.beans.com”(目前正在发生)。
我该怎么做?