Wordpress redirect non-www to secure www not working

Keywords: WordPress - AWS - Technical issue - Secure Connections (SSL/HTTPS)
Description:
On a linux AMI wordpress instance, I would like to redirect non-www to www and force https in all cases.

The site is:
www.ishvarayoga.org

It currently works fine for https www, https non-www and http www, but it doesn’t seem to work for http non-www.

i.e. if http://ishvarayoga.org it entered, it doesn’t forward to the https www version which is what I would like it to do.

Any help greatly appreciated.

Hello @ishy,

We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Hello @ishy,

I have been checking your support tool and I can see you have several apps under /opt/bitnami/apps. Which one is the one you are serving?

Apart from that, some files were missing in the support output, and it is difficult to figure out the issue without them. It could be related to memory or storage issues. Could you please execute these commands:

sudo df -h
sudo free -m

This is our documentation to redirect non-www to www:
https://docs.bitnami.com/aws/apps/wordpress/administration/redirect-custom-domains/#redirect-myappexamplecom-to-wwwmyappexamplecom-126

This is our documentation to force https:
https://docs.bitnami.com/aws/apps/wordpress/administration/force-https-apache/#approach-b-self-contained-bitnami-installations

Regards

Hello @davidg,

Thanks for looking into this. The app that this relates to is:
/opt/bitnami/apps/ishvarayoga

You are right, it does look like the size is getting a little tight. I get the following when I run the commands you requested. I notice from a quick look around that the /snap folder is taking up 1.3G so wonder if anything in there can be deleted (or anything else that would free up some extra space)?

sudo df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M   11M   89M  11% /run
/dev/xvda1      9.7G  8.6G  1.1G  89% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
/dev/loop0       33M   33M     0 100% /snap/amazon-ssm-agent/2996
/dev/loop1       56M   56M     0 100% /snap/core18/1997
/dev/loop2       34M   34M     0 100% /snap/amazon-ssm-agent/3552
/dev/loop3       56M   56M     0 100% /snap/core18/1988
/dev/loop4      100M  100M     0 100% /snap/core/10908
/dev/loop5      100M  100M     0 100% /snap/core/10958
tmpfs           100M     0  100M   0% /run/user/1000

sudo free -m

              total        used        free      shared  buff/cache   available
Mem:            990         401          68          91         520         288
Swap:           634         568          66

This is our documentation to redirect non-www to www:
https://docs.bitnami.com/aws/apps/wordpress/administration/redirect-custom-domains/#redirect-myappexamplecom-to-wwwmyappexamplecom-126

I followed the guidance in the link provided on “Redirect myapp.example.com to www.myapp.example.com” and edited the /opt/bitnami/apps/APPNAME/conf/httpd-vhosts.conf file accordingly (and restarted Apache) but this did not appear to solve the problem unfortunately so I reverted the httpd-vhosts.conf file back to its original form.

Thanks.

Hello @ishy,

First of all, I can see your instance is using a lot of swap.

You could try to increase your machine type if you face performance issues. This guide explains the process
https://docs.bitnami.com/aws/faq/administration/change-server-type/

Let me share with you our troubleshooting documentation:
https://docs.bitnami.com/aws/how-to/troubleshoot-wordpress-issues/
https://docs.bitnami.com/aws/faq/troubleshooting/troubleshoot-server-performance/

We also have a guide to optimize Wordpress:
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/optimize-bitnami-wordpress/

After solving those issues, try to run the support tool again in case we can gather those missing files.

Regards

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.