MyBB Community Forums

Full Version: Http Not Redirecting To Https On Every Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello MyBB lovers!

I'm using the latest version of the MyBB and have a SSL certificate installed from my hosting company.

Suddenly, i came across an idea when i was browsing my forum's threads. I put http: instead of https: in the browser and it will not redirect me automatically to the https site.

Let me add that if i change from https to http on the index page , it will automatically redirect me to the https ,so,it is working fine there.

This is my .htaccess file:


RewriteEngine on

# Some hosts require RewriteBase to make RewriteRules work.
RewriteBase /

# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
RewriteRule ^([^&]*)&(.*)$ https://myforum.com/$1?$2 [L,QSA,R=301]

# Google SEO 404:
ErrorDocument 404 /

# Google SEO Sitemap:
RewriteRule ^sitemap\-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]

# Google SEO URL Forums:
RewriteRule ^Forum\-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]

# Google SEO URL Threads:
RewriteRule ^Thread\-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]

# Google SEO URL Announcements:
RewriteRule ^Announcement\-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]

# Google SEO URL Users:
RewriteRule ^User\-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]

# Google SEO URL Calendars:
RewriteRule ^Calendar\-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]

# Google SEO URL Events:
RewriteRule ^Event\-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]


RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.myforum.com [NC]
RewriteRule ^(.*)$ https://myforum.com/$1 [L,R=301,NC]
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Should i add something else to the .htaccess?

Thankyou in advance.
If the site is using reverse proxies (e.g. Cloudflare), they might need additional configuration to enforce HTTPS:

https://support.cloudflare.com/hc/en-us/...SL-options (Full (strict) option recommended)
https://docs.mybb.com/1.8/administration...se-proxies
Hello and thanks for your help.

I have enabled the full strict mode in Cloudflare and the changed a setting as shown in the following screenshot.

Everything is workig on https now.

Kind regards.

[attachment=41803]