Portal logout button taking me to wrong page

windows server 2022 | xampp 3.3.0 | php 8.1.6 | openemr 7.0.3-3 | Edge

Is taking me to https://[site]./logout instead of https://[site]/portal/logout

The issue you’re describing — being redirected to https://[site]./logout instead of https://[site]/portal/logout — is most likely caused by a malformed or misconfigured base URL or redirect path in your OpenEMR configuration.

Here’s how to solve it:

:white_check_mark: 1. Check globals.php (OpenEMR configuration)

Open the file:

C:\xampp\htdocs\openemr\sites\default\sqlconf.php

Look for the $webroot or $GLOBALS[‘webroot’] settings.

Ensure this is correctly set to your OpenEMR root:

$GLOBALS[‘webroot’] = “/openemr”; // Or “” if OpenEMR is at domain root

Also verify in:

C:\xampp\htdocs\openemr\interface\globals.php

Make sure:

$web_root = rtrim(dirname($_SERVER[‘PHP_SELF’]), ‘/\’);

No trailing dots or malformed slashes should be there.

:white_check_mark: 2. Check Portal Configuration

In the OpenEMR admin panel:

Go to Administration → Globals → Portal

Make sure the Patient Portal Base URL is correct.

It should be:

https://yourdomain.com/portal

And NOT:

https://yourdomain.com./portal ← (note the dot, that’s a problem)

:white_check_mark: 3. Check Apache Virtual Host or .htaccess (optional)

If you’re using a virtual host, confirm it’s correctly defined in:

C:\xampp\apache\conf\extra\httpd-vhosts.conf

Or check if any .htaccess file under htdocs/ or openemr/ has redirect rules with malformed slashes or dots.

:white_check_mark: 4. Check Patient Portal Login/Logout Code

In:

openemr/portal/index.php

or wherever logout is triggered, ensure it’s redirecting to:

header(“Location: {$GLOBALS[‘webroot’]}/portal/logout.php”);

Avoid this:

header(“Location: ./logout.php”); // May resolve incorrectly

:white_check_mark: 5. Clear Edge Browser Cache

Sometimes this can be a cache issue:

Go to Edge settings → Privacy → Clear browsing data → Select “Cached images and files” and “Cookies” → Clear.

Thank you for your information

My sqlconf.php file does not have $webroot or $GLOBALS[‘webroot’]

It just has info about accessing the db

In admin | config | portal I have Patient Portal Site Address: https://[site]/openemr/portal

In admin | config | misc I have Site Address Override: https://[site]

Everything about the portal is working fine, except for the logout button. When I hover over all the buttons on the dashboard, I can see the url they will take me to, looking in the bottom left corner of the screen. For all buttons, the url is correct, except for logout which has “/portal” replaced by a period.

I looked at logout.php, home.php and verify_session.php but have not located where the problem is. Any other ideas?

Thanks

This is working okay for me. Have you tried on demo server? Still I’ll look into this later today.

Tried the demo site. Same error
logout button is trying to take me to https://demo.openemr.io/openemr./logout.php