XF 1.5 Problem with htaccess when changing to https

PaulineK

Member
I have changed my site from http to https using rewrite rules in .htaccess at the route level. However, something conflicts in the .htaccess at the level where I have my Xenforo forums installed.

Can I move the rules in the .htaccess at the forums level to the .htaccess at the root level? Or do I need to add something to the forums level .htaccess?

What happens now is that the forums work with either http or https, but if you enter on http it does not redirect to https and it does on the rest of the site.

Rewrite rules for http to https in .htaccess at root level:
RewriteCond %{REQUEST_URI} !^/fcgi-bin/
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Rules in .htaccess at forums level (created by the xenforo install):
<IfModule mod_rewrite.c>
RewriteEngine On
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>
 

Mike

XenForo developer
Staff member
Can I move the rules in the .htaccess at the forums level to the .htaccess at the root level? Or do I need to add something to the forums level .htaccess?
You can't move the forum rules, but where have you added this .htaccess redirect? It would need to go in the forum directory's .htaccess (as well as any .htaccess above that, if applicable).
 

PaulineK

Member
Thanks, I will put my rewrite rules for http to https into the htaccess at the forums level, as well as having them at the root level.
 
Top