Host a blog on another server?

I currently have a blog of my companies on the same server as our main web application, as in example.com/blog

What would be the easiest way to move the blog to another server, but still allow users to either access the blog in example.com/blog, or blog.example.com?

+3
source share
5 answers

Issue 301 HTTP redirects from website.com/blog to blog.website.com

The specifics depend on the server.

+2
source

The answer I provide suggests that you are using Apache as a web server, as that is what I am familiar with. If you use IIS, then you can find a similar solution, but I can not guarantee this.

, - www.mydomain.com, blog.mydomain.com. SEO , www.mydomain.com/blog, - DNS.

Apache mod_proxy, URL-/ , , , . CodeHaus mod_proxy ( 2016: , ), .

mod_proxy , , , , , .

+2

javascript, , .

<script type="text/javascript">
<!--
window.location = "http://www.example.com/";
//-->
</script>
+1

? . URL-.

http://www.foo.com/assets/ * HTTP- Apache, ,

http://www.foo.com/apps/ * JEE

http://www.foo.com/services/ * , -,

http://www.foo.com/blog/ * , , WordPress.

... . , mod_proxy, ( , ).

0

blog.example.com

blog.example.com , IP-.

, , .

example.com/blog

Apache mod_proxy, /blog . Apache docs .

This worked well:

ProxyPass /blog http://blog.example.com/
ProxyPassReverse /blog http://blog.example.com/

But only after the proxy modules load correctly:

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_html_module /usr/lib/apache2/modules/mod_proxy_html.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

Notes

  • Due to CloudFlare, I also had to host a blog with a different hostname, not *.example.com.
  • I added Disallow: /to mine blog.example.com/robots.txt. Like these search engines will not start indexing in two places. And search engines just ignore it blog/robots.txt.
0
source

Source: https://habr.com/ru/post/1725272/


All Articles