The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Force https on login.php
#1
I saw that there is a Force HTTPS setting in the admin settings. I don't necessarily want my entire site served via HTTPS, but I do want the login page to require it. Is there any way to force just the login page to use HTTPS?
  Reply
#2
You can just drop the same code snippet we use in your login.php or (preferably) copy your login.php over to usersc/login.php, point the init to ../users/init.php and add this snippet somewhere near the top...


Code:
if (!isset($_SERVER['HTTPS']) || !$_SERVER['HTTPS']) {
Code:
$url = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
Code:
Redirect::to($url);
Code:
exit;
Code:
}
  Reply
#3
That worked perfectly. Thanks!
  Reply
#4
Awesome! Glad to help.
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)