admin管理员组文章数量:1124555
I have a website set up for my organisation under www.mycompany
(running on Amazon S3). I also have a Wordpress blog set up under blog.mycompany
(running on a separate LAMP server).
For SEO purposes, our marketing department has asked to set up www.mycompany/blog
to go to our blog main page.
Our website is currently hosted on an Amazon S3 bucket, behind Amazon Cloudfront. I have managed to set up S3/CloudFront redirections successfully so that a basic redirection happens automatically, e.g.:
www.mycompany/blog
-> blog.mycompany/blog
www.mycompany/blog/my-article
-> blog.mycompany/blog/my-article
Which is all fine, except for the fact that Wordpress shows blog.mycompany
as the subdomain.
Is there any way that we can still show in the URL bar the www
subdomain in place of blog
? e.g. so it still shows www.mycompany/blog/my-article
?
Is there some way we can use mod_rewrite
or similar to alter the URL for the Wordpress site?
I have a website set up for my organisation under www.mycompany.com
(running on Amazon S3). I also have a Wordpress blog set up under blog.mycompany.com
(running on a separate LAMP server).
For SEO purposes, our marketing department has asked to set up www.mycompany.com/blog
to go to our blog main page.
Our website is currently hosted on an Amazon S3 bucket, behind Amazon Cloudfront. I have managed to set up S3/CloudFront redirections successfully so that a basic redirection happens automatically, e.g.:
www.mycompany.com/blog
-> blog.mycompany.com/blog
www.mycompany.com/blog/my-article
-> blog.mycompany.com/blog/my-article
Which is all fine, except for the fact that Wordpress shows blog.mycompany.com
as the subdomain.
Is there any way that we can still show in the URL bar the www
subdomain in place of blog
? e.g. so it still shows www.mycompany.com/blog/my-article
?
Is there some way we can use mod_rewrite
or similar to alter the URL for the Wordpress site?
1 Answer
Reset to default 3You are using Cloudfront in front of S3, so in order to mix in 2 sources of content you need to
on your blog.mycompany.com - add rewrites of blog/* -> /* so that your blog can handle blog.mycompany.com/blog/ urls well.
add new blog.mycompany.com as an Origin in "Origins and Origin Groups" tab.
add new "Behavior" for /blog* path pattern and point it to your newly created "blog.mycompany.com" origin.
if you get redirects from blog (e.g. WPMU can do that) - hack $_SERVER hostname variable in your wp-config.php and replace it
本文标签: subdomainsHosting a Wordpress blog as a sub folder from a S3 website
版权声明:本文标题:subdomains - Hosting a Wordpress blog as a sub folder from a S3 website 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736637588a1945917.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
www.mycompany.com
is hosted on S3 (plain HTML site), andblog.mycompany.com
is on another server altogether that is running a LAMP stack. What I would like is to redirect the /blog subfolder from my S3 site to the LAMP box without changing thewww
subdomain. – CyberFerret Commented Jan 23, 2017 at 6:41