MyBB Community Forums

Full Version: SSL Issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, so I read the docs on SSL and my site SSL works when I add the "s" to https and every page comes up SSL afterwards
but SSL doesn't work when I just use example.com

I have two files that are:

htaccess-nginx.text
htaccess.text

the file that is htaccess-nginx.text I didn't touch

but the file that is htaccess.text, I added

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

directly under this text that was already in the file:

<IfModule mod_rewrite.c>
RewriteEngine On

..................................................

now the htaccess-nginx.text looks like
# Note: You are able to choose a different name in the Admin CP. If you've done that you need to change it here too
location ~ /error.log 
{ 
    deny all; 
}

# Note: You are able to rename the admin directory. If you've done that, you need to change it here too
location /admin/backups {
    deny all;
}

rewrite ^/forum-([0-9]+).html$ /forumdisplay.php?fid=$1 last;
rewrite ^/forum-([0-9]+)-page-([0-9]+).html$ /forumdisplay.php?fid=$1&page=$2 last;
rewrite ^/thread-([0-9]+).html$ /showthread.php?tid=$1 last;
rewrite ^/thread-([0-9]+)-page-([0-9]+).html$ /showthread.php?tid=$1&page=$2 last;
rewrite ^/thread-([0-9]+)-lastpost.html$ /showthread.php?tid=$1&action=lastpost last;
rewrite ^/thread-([0-9]+)-nextnewest.html$ /showthread.php?tid=$1&action=nextnewest last;
rewrite ^/thread-([0-9]+)-nextoldest.html$ /showthread.php?tid=$1&action=nextoldest last;
rewrite ^/thread-([0-9]+)-newpost.html$ /showthread.php?tid=$1&action=newpost last;
rewrite ^/thread-([0-9]+)-post-([0-9]+).html$ /showthread.php?tid=$1&pid=$2 last;
rewrite ^/post-([0-9]+).html$ /showthread.php?pid=$1 last;
rewrite ^/announcement-([0-9]+).html$ /announcements.php?aid=$1 last;
rewrite ^/user-([0-9]+).html$ /member.php?action=profile&uid=$1 last;
rewrite ^/calendar-([0-9]+).html$ /calendar.php?calendar=$1 last;
rewrite ^/calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+).html$ /calendar.php?calendar=$1&year=$2&month=$3 last;
rewrite ^/calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+).html$ /calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 last;
rewrite ^/calendar-([0-9]+)-week-(n?[0-9]+).html$ /calendar.php?action=weekview&calendar=$1&week=$2 last;
rewrite ^/event-([0-9]+).html$ /calendar.php?action=event&eid=$1 last;

Any idea what I can do to force example.com to become SSL?

The weird thing is, when I click the logo, the page becomes SSL: https://example/index.php
and all pages are ssl afterwards.
Use this and you'll be redirected to HTTPS whenever you tried with HTTP https://community.mybb.com/thread-186207...pid1196868

Also rename htaccess.txt to .htaccess
(2017-01-19, 06:34 AM)Dark-Power-Invader Wrote: [ -> ]Use this and you'll be redirected to HTTPS whenever you tried with HTTP https://community.mybb.com/thread-186207...pid1196868

Also rename htaccess.txt to .htaccess

Hi and thanks, unfortunately, it didn't work but I appreciate the reply

(2017-01-19, 06:34 AM)Dark-Power-Invader Wrote: [ -> ]Use this and you'll be redirected to HTTPS whenever you tried with HTTP https://community.mybb.com/thread-186207...pid1196868

Also rename htaccess.txt to .htaccess

When I go to rename the file to .htaccess, I get a popup that says file aleady exists, although I can't find it anywhere
Check that hidden files are set to be displayed.
I used certbot and it worked quite well without hassle
Here is the nginx version
https://www.digitalocean.com/community/t...untu-14-04
If you are on cpanel file manager from paper lantern theme on top right corner there is an option called settings click on that and check the option Show hidden Files and hit the save button. Check if there is a .htaccess file in your forum root directory then rename it to anything like htaccessold and rename your htaccess.txt to .htaccess.
Hey bro, @Matt, @Metulburr @Dark-Power, you guys are awesome, I appreciate the help!

Dam! when I activated the hidden files, there are multiple htaccess files!

Check it out!
/.htaccess
public_html/.htaccess.text
/public_html/htaccess-nginx.txt
/public_html/.htaccess.text
/public_html/htaccess.text
public_html/.htaccess01162017
/public_html/Upload/.htaccess
/public_html/Upload/htaccess-nginx.txt
/public_html/Upload/admin/backups/.htacces
/public_html/admin/backups/.htaccess

lol, not what I was expecting to find, what do you guys think?

Got it fixed. Looking at the hidden files, I added the rerwrite rules in the files that were coded for the rewrite and did this ".htaccess file in your forum root directory then rename it to anything like htaccessold and rename your htaccess.txt to .htaccess."

then any third party urls used within the theme template urls were changed to https and that did the trick!
Glad your problem is fixed. :thumbsup: