2 個答案
- 最新
- 最多得票
- 最多評論
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!
已回答 3 個月前
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>
相關內容
- AWS 官方已更新 9 個月前
- AWS 官方已更新 3 年前
- AWS 官方已更新 1 年前
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?