我正在使用虚拟子域来捕获我的站点的所有流量,并使用子域作为应用程序中的标识符。所有到非子域网址的流量都应该使用index.html;但我没有任何幸运的重定向将子域流量发送到正确的页面。到目前为止,我得到了:
suPHP_ConfigPath /var/sites/w/domain.org/
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.domain.org$ [NC]
RewriteCond %{HTTP_HOST} !^domain.org$ [NC]
RewriteRule ^(.*)$ /sub.html索引页面加载到域URL,但是子域URL得到一个500错误,而不是重定向到http://sub.domain.org/sub.html (注意,将子域保留在重定向的URL中是很重要的)。
有谁能给我指个方向吗?
发布于 2014-09-30 06:14:09
尝试包含一个条件以检查URI是否已为/sub.html
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.domain.org$ [NC]
RewriteCond %{HTTP_HOST} !^domain.org$ [NC]
RewriteCond $1 !^sub\.html
RewriteRule ^(.*)$ /sub.htmlhttps://stackoverflow.com/questions/26107309
复制相似问题