2 Answers
- Newest
- Most votes
- Most comments
1
After playing around with it, I was able to get a successful redirect by editing opt/bitnami/apache/conf/vhosts/00_status-vhost.conf
with your above code:
Define CUSTOM_DOMAIN_NAME "example.com"
RewriteEngine On
<VirtualHost *:80 *:443>
ServerName www.example.com
RewriteRule ^/(.*) https://${CUSTOM_DOMAIN_NAME}/$1 [R=301,L]
</VirtualHost>
All seems to be working now! Thank you!
answered 2 months ago
1
Hello.
Can I redirect if I configure Apache as below?(After making the settings, restart Apache.)
Define CUSTOM_DOMAIN_NAME "example.com"
RewriteEngine On
<VirtualHost *:80 *:443>
ServerName www.example.com
RewriteRule ^/(.*) https://${CUSTOM_DOMAIN_NAME}/$1 [R=301,L]
</VirtualHost>
Relevant content
- asked a year ago
- asked 9 months ago
- asked 5 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 3 months ago
Thanks for the suggestion, but unfortunately, it doesn't seem to have worked.
I edited this file
/opt/bitnami/apache/conf/httpd.conf
and added the virtual host code (after swapping out my domain for example.com), saved the file, restarted Apache, reset my CloudFront cache too for good measure, and no luck. I've tried from multiple browsers/computers too, double checked for redirects using a 3rd party, and no dice.Is that the correct file?