All pages return 404 except the home page
-
HTTPS can be defined via a variable different from $_SERVER[‘HTTPS’], opening via https may not work and 404 will be returned.
Solved via fix:
function get_current_url()
{
$REQUEST_URI = strtok($_SERVER['REQUEST_URI'], '?');
$isHttps = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1))
|| (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
|| (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443);
$real_url = (isset($_SERVER['HTTPS']) && $isHttps) ? 'https://' : 'http://';
$real_url .= $_SERVER['SERVER_NAME'] . $REQUEST_URI;
$test = isset($_SERVER['HTTPS']);
error_log($test);
return $real_url;
}
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘All pages return 404 except the home page’ is closed to new replies.