htaccess redirect on XF 2.1 breaks login

New member
I am having a problem with login to my XF 2.1 site with a set htaccess redirects to hide the specific subfolder the forum is installed to.

I did a upgrade on our site from XF 1.5 -> XF 2.1 (on a test server, don't want to break the world)

Our site uses "Friendly URLs" and hides the directory of the installation. (ie -> with a pair of htaccess files. When I first implemented our test site at XF 1.5, everything worked correctly, URLs were redirected and the subfolder was hidden from every publicly facing URL.

Since upgrading to XF 2.1, login is broken, it constantly loops to the login (login/login) page and never logs in. Strangely if I login via admin.php (which works) and I can then navigate to the test board and everything appears to be working correctly (until I logout)

Here are the two htaccess files I use.

(in the webroot)

RewriteCond %{REQUEST_URI} !^/images/ [NC] RewriteRule !^test/ test/%{REQUEST_URI} [NC,L]

(in the "test" subdirectory where XenForo is installed)

ErrorDocument 401 default ErrorDocument 403 default ErrorDocument 404 default ErrorDocument 405 default ErrorDocument 406 default ErrorDocument 500 default ErrorDocument 501 default ErrorDocument 503 default <IfModule mod_rewrite.c> RewriteEngine On Options FollowSymLinks # If you are having problems with the rewrite rules, remove the "#" from the # line that begins "RewriteBase" below. You will also have to change the path # of the rewrite to reflect the path to your XenForo installation. #RewriteBase /xenforo # This line may be needed to enable WebDAV editing with PHP as a CGI. #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # this works but failed to allow login RewriteCond %{THE_REQUEST} /test/(\S*)\s [NC] RewriteRule ^ /%1 [R=301,NC,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L] RewriteRule ^.*$ index.php [NC,L] </IfModule>

I am a bit of a noob with htaccess and XenForo, but this is rather confusion, and I do not understand why this no longer works. I also see no error messages or other issues to clue me in. Any tips or clues would be greatly appreciated.

Last edited: