We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

In EE3, how force HTTPS in Admin (Control Panel)?

Development and Programming

dmDev08's avatar
dmDev08
100 posts
9 years ago
dmDev08's avatar dmDev08

I want to force all admin pages to be https only. How do I set this?

       
TJ Draper's avatar
TJ Draper
222 posts
9 years ago
TJ Draper's avatar TJ Draper

If you’re running on Apache (most likely) and you don’t mind your whole site running over https (which these days you should do anyway if you’ve already got SSL set up on the server) you can drop this in your .htaccess file. If a .htaccess file does not exist in your public directory, you can create it.

# Make sure the following line is in your htaccess file before the rewrite
RewriteEngine On

# These two lines force SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
       
dmDev08's avatar
dmDev08
100 posts
9 years ago
dmDev08's avatar dmDev08
If you’re running on Apache (most likely) and you don’t mind your whole site running over https (which these days you should do anyway if you’ve already got SSL set up on the server) you can drop this in your .htaccess file. If a .htaccess file does not exist in your public directory, you can create it.
# Make sure the following line is in your htaccess file before the rewrite
RewriteEngine On

# These two lines force SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

Thank you, but how would I restrict it to only the admin?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.