Hi, I have been trying to figure out this strange behavior on my Local site that consists of a WordPress install as well as standalone HTML pages and a vBulletin forum. The WordPress pages are all loading in https as expected but when I link to static or forum pages with the https protocol, they load as http instead. This seems to only be an issue when the URL’s do not contain a trailing slash.
i.e. a link with https://mydomain.local/somepage will turn into http://mydomain.local/somepage.
However, if the link contains a trailing slash, https://mydomain.local/somepage/ it will load as https without issue.
Any idea what server setting I’d need to look into to correct this?
Thanks!
That’s definitely odd behavior @Alberto –
What you are describing almost sounds like some issues with rewrites.
I’m assuming this is a custom environment – did you add any additional rewrite rules to the NGINX config in order to make vBulletin work?
Also, in your example, is https://mydomain.local/somepage
a WordPress page, or is it a directory containing an index.html
file?
– Ben
Hi Ben, thanks for the quick reply. Yes, this is a custom environment with Apache, PHP 7, and WP. All links to WordPress pages load fine with https.
vBulletin worked without any modifications to .htaccess but exhibits the same strange behavior.
The example I mentioned earlier, https://mydomain.local/somepage is not part of WordPress but a directory containing an index.html file. The directory is protected by aMember membership software so there is a custom .htaccess file:
########### AMEMBER START #####################
Options +FollowSymLinks
RewriteEngine On
# if cookie is set and file exists, stop rewriting and show page
RewriteCond %{HTTP_COOKIE} amember_nr=([a-zA-Z0-9]+)
RewriteCond /app/public/amember/data/new-rewrite/%1-1 -f
RewriteRule ^(.*)$ - [S=3]
# if cookie is set but folder file does not exists, user has no access to given folder
RewriteCond %{HTTP_COOKIE} amember_nr=([a-zA-Z0-9]+)
RewriteCond /app/public/amember/data/new-rewrite/%1-1 !-f
RewriteRule ^(.*)$ https://mydomain.local/amember/no-access/folder/id/1?url=%{REQUEST_URI}?%{QUERY_STRING}&host=%{HTTP_HOST}&ssl=%{HTTPS} [L,R]
## if user is not authorized, redirect to login page
# BrowserMatch "MSIE" force-no-vary
RewriteCond %{QUERY_STRING} (.+)
RewriteRule ^(.*)$ https://mydomain.local/amember/protect/new-rewrite?f=1&url=%{REQUEST_URI}?%1&host=%{HTTP_HOST}&ssl=%{HTTPS} [L,R,B]
RewriteRule ^(.*)$ https://mydomain.local/amember/protect/new-rewrite?f=1&url=%{REQUEST_URI}&host=%{HTTP_HOST}&ssl=%{HTTPS} [L,R]
########### AMEMBER FINISH ####################
Thank you.
Oh man, I’m afraid my knowledge of Apache directives isn’t that good.
If you poke around in the logs/apache
folder for this site – is there any information in one of the logs?
I wonder if there are any errors that Apache is logging about this kind of a thing.
– Ben
I just looked that the Apache logs and nothing related to the issue that I can find. I’m not knowledgeable about Apache directives myself and all I can say is this same .htaccess file is generated for the production version of the site and working without issue.
I actually contacted the support team at aMember and we checked all the configuration options. We ran out of things to check and they suggested it looks to be a server configuration issue.
Please let me know how we might proceed from here.