我们在Elastic Loadbalancer后面运行了一个AWS beanstalk WordPress应用程序,并且希望WP网站能够从其中一个带有cloudfront的S3网站打开一个页面而无需更改地址栏中的URL。例如,wpbeanstalk.com/xyz应该打开s3website.com/a1/page.html。我尝试使用RewriteRule在.htaccess中执行此操作,但URL更改为301,我现在使用Iframe在WP应用程序上加载S3website页面,但这不是一个可行的解决方案。任何人都可以建议最佳实践来实现这一目标吗?
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{REQUEST_URI} .ride/$
RewriteRule (.*) awsS3.Website.com/f1/index.html [R=301,L]
</IfModule>
答案 0 :(得分:0)
您可以将CloudFront放在Wordpress站点和S3存储桶的前面,然后配置Lamdba @ edge函数以使用正确的S3文件修改原始响应。