本人已经在linux下面配好了rewrite转发,结果服务器应用了负载均衡,导致转发失效,求高人指点.<VirtualHost *:80>
ServerAdmin root@localhost
VirtualDocumentRoot /usr/local/www/apache22/data
ServerName *.my.com
ServerAlias *.my.com
# UseCanonicalName Off
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^group\.my\.com$
RewriteRule ^/$ http://www.my.com/community/index.php [L] RewriteCond %{HTTP_HOST} ^group\.my\.com$
RewriteCond %{REQUEST_URI} ^(/index\.php|/index\.html|/index\.htm)
RewriteRule ^(/index\.php|/index\.html|/index\.htm)$ http://www.my.com/community/index.php [L] RewriteCond %{HTTP_HOST} ^group\.my\.com\/*$
RewriteCond %{REQUEST_URI} !^(/index\.php|/index\.html|/index\.htm)
RewriteRule ^/(.[a-zA-Z0-9_]+)$ http://www.my.com/community/grouphome.php?groupname=$1 [L] RewriteCond %{HTTP_HOST} ^folio\.my\.com\/*$
RewriteCond %{REQUEST_URI} !^(/index\.php|/index\.html|/index\.htm)
RewriteRule ^/(.[a-zA-Z0-9_]+)$ http://www.my.com/office/tinofolio.php?username=$1 [L]
</IfModule>
</VirtualHost>
ServerAdmin root@localhost
VirtualDocumentRoot /usr/local/www/apache22/data
ServerName *.my.com
ServerAlias *.my.com
# UseCanonicalName Off
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^group\.my\.com$
RewriteRule ^/$ http://www.my.com/community/index.php [L] RewriteCond %{HTTP_HOST} ^group\.my\.com$
RewriteCond %{REQUEST_URI} ^(/index\.php|/index\.html|/index\.htm)
RewriteRule ^(/index\.php|/index\.html|/index\.htm)$ http://www.my.com/community/index.php [L] RewriteCond %{HTTP_HOST} ^group\.my\.com\/*$
RewriteCond %{REQUEST_URI} !^(/index\.php|/index\.html|/index\.htm)
RewriteRule ^/(.[a-zA-Z0-9_]+)$ http://www.my.com/community/grouphome.php?groupname=$1 [L] RewriteCond %{HTTP_HOST} ^folio\.my\.com\/*$
RewriteCond %{REQUEST_URI} !^(/index\.php|/index\.html|/index\.htm)
RewriteRule ^/(.[a-zA-Z0-9_]+)$ http://www.my.com/office/tinofolio.php?username=$1 [L]
</IfModule>
</VirtualHost>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货