• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 how to force HTTPS at .htacces xenforo

Jake Bunce

XenForo moderator
Staff member
#2
I don't have a secure cert to really test this, but this should work:

Code:
Redirect 301 / https://www.yoursite.com/
If this is in a subdirectory then it would be:

Code:
Redirect 301 /subdir https://www.yoursite.com/subdir
 

rEd86

Active member
#5
Some else that's a better with regular expressions can step up and correct me (I just don't do them that often) but I THINK this will work:

RewriteRule ^(.*/)*$ https://www.yourdomain.com/$1 [R=301,L]

I also changes the "R" at the end (redirect) to include the code 301, which is a permanent redirect. That way search engines will hit the right place the second time they try and index content.

--Ed
 

Jake Bunce

XenForo moderator
Staff member
#6
When I searched Google I found lots of people using rewrites for this. I don't like that solution. A redirect seems more appropriate. Though I had trouble finding a way to check the protocol using a redirect, hence the plain redirect in my previous post.