子域名不支持包含此htaccess文件的托管
此代码文件“.htaccess”:
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteRule ^(.*)/cgi-bin/(.*?)/ $2.php?lang=$1 [L,NC,QSA]
我想要如下: https://example.com/us/cgi-bin/index/来 https://subdomin.example.com/us/cgi-bin/index/
取决于上述文件“.htaccess”。
请帮我解决这个问题
答案 0 :(得分:0)
请使用您的域值
尝试以下代码RewriteCond %{ENV:REDIRECT_SUBDOMAIN} =""
RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.domain\.com\.?(:80)?$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%1 -d
RewriteRule ^(.*) %1/$1 [E=SUBDOMAIN:%1,L]
RewriteRule ^ - [E=SUBDOMAIN:%{ENV:REDIRECT_SUBDOMAIN},L]