Rewriting URL

Andy To

Member
I have installed Xenforo into a subdirectory (community) and normally the URL will appears to be www.example.com/community. I have use a .htaccess to rewrite the URL to www.example.com, so that any site will be www.example.com without the community. Everything works fine except for accessing the ACP. Did I miss something in the .htaccess file?

The ACP shows "This action could not be completed because you are no longer logged in." when trying to login.

Code:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/community/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /community/$1

RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ community/index.php [L]
 
Top Bottom