Pages

Thursday, 17 January 2013

对于不支持绑定子目录但支持htaccess的空间来说,可以用htaccess无限绑子目录


下面htaccess无限绑子目录规则:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(bbs.)?urdomain.com$
RewriteCond %{REQUEST_URI} !^/bbs/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /bbs/$1
RewriteCond %{HTTP_HOST} ^(bbs.)?urdomain.com$
RewriteRule ^(/)?$ bbs/index.php [L]