-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bitnami/wordpress] Redirect IP access to domain #949
Comments
Hi @jnayak01, Thanks for using Bitnami. Can you run the bndiagnostic tool and share the generated code with us so we can check your Apache configuration? https://docs.bitnami.com/general/how-to/understand-bndiagnostic/ |
Hi @gongomgra , |
Hi @jnayak01, Thanks for sharing the info. I reviewed the Apache config and I think I know what can be happening. First of all, we highly encourage you to create a server backup before modifying any config file so you can easily restore your current status https://docs.bitnami.com/aws/faq/administration/backup-restore-server/ Regarding your Apache config, I don't see anywhere the configuration related to our section for 'redirect all domains to your own domain and force HTTPS'. The current configuration you have only redirects requests which already include a domain name. Can you add the new redirect section after the current configuration and then restart Apache service for changes to take effect? You can restart Apache by running the next command
|
Hi @gongomgra , Following the instruction in the link you provided, I added the redirect section and restarted Apache, but it did not work.
I ran the diagnostics once more - the code is Do you want to take a look directly at the server conf files ? Please let me know if I am missing anything else here . |
Hi @jnayak01, Thanks for the new bndiagnostic code. I checked it and I think the Apache configuration is correct. It is also working for me from the command line
Can you check if your browser is caching the website on your side? I browsed using an incognito window and it worked fine as well. |
Hi @gongomgra , Thank you for your response. I cleared the cache and also tried accessing the website via IP in incognito mode. The HTTP works fine but the issue still persists for HTTPS. The IP via HTTPS is still accessible, and accessing any random location (like https://ip/non-existing-file/) shows a 404 but it does not redirect to the domain. If you access just the IP via HTTPS, without any subdirectory, it does not redirect you to the domain. |
Hi @gongomgra , |
Hi @jnayak01, The issue with the IP address and HTTPS is that the IP address is not covered by the SSL certificate
However, when requesting the HTTP version of your website using the IP address, it gets properly redirected
From our experience, the second use case (accessing via HTTP with the IP address) is the most frequent of them. It is not usual accessing an IP address with HTTPS. In case you need to cover that specific use case, you will have to get your server IP address included in the SSL certificate, and also include the Apache configuration to redirect non-domain requests to your domain in the |
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary. |
Name and Version
bitnami/wordpress 6.2.2
What architecture are you using?
None
What steps will reproduce the bug?
I can provide the original IP address over
Are you using any custom parameters or values?
No response
What is the expected behavior?
Redirect all attempts to access the website's public IP (XX.XX.XX.XX) over to the domain.
What do you see instead?
The IP via HTTPS is still accessible, and accessing any random location (like https://ip/non-existing-file/) shows a 404 but it does not redirect to the domain.
If you access just the IP, without any subdirectory, it does not redirect you to the domain.
Additional information
Hello, I'm working on Wordpress website hosted in AWS Lightsail with a Bitnami package.
I'd like to redirect all attempts to access the website's public IP (XX.XX.XX.XX) over to the domain. Basically, when a user or attacker tries to access https://xx.xx.xx.xx/home or https://xx.xx.xx.xx/some-page/ or http://xx.xx.xx.xx/ we'd like to force-redirect them to https://www.mydomain.com/home or https://www.mydomain.com/some-page/ or https://www.mydomain.com/ correspondingly.
So far, none of the solutions we've researched online have helped me.
The IP via HTTPS is still accessible, and accessing any random location (like https://ip/non-existing-file/) shows a 404 but it does not point to the domain.
If you access just the IP, without any subdirectory, it does not redirect you to the domain.
We are using the Bitnami HTTPS configuration tool (bncert) to enable HTTPS on our Certified by Bitnami WordPress instance on Amazon Lightsail (ref- https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-enabling-https-on-wordpress ). We followed the steps in the article to enable HTTP to HTTPS redirection and non-www to www redirection. Also we referred the following article to redirect All Domains To Your Own Domain And Force HTTPS - https://docs.bitnami.com/aws/apps/wordpress/administration/use-single-domain/
If you access the website via domain name, the redirections happen properly.
CURRENT INCORRECT BEHAVIOUR WE SEE
Summary - I want to restrict any access to the website via IP , instead redirect IP access through domain
The text was updated successfully, but these errors were encountered: