Content Migration - Redirect URL with same hostname | Community
Skip to main content
sivas13911460
December 28, 2020
Solved

Content Migration - Redirect URL with same hostname

  • December 28, 2020
  • 2 replies
  • 1842 views

Hi All,

 

We are migrating content from one server to other server with below requirement.

1. We have two sites:

www.sitea.com/home/<pagename>.html

www.siteb.com/store/<pagename>.html

 

Content structure on Server A :  /content/siteA/home/*

Site name is :   www.sitea.com/home/abc.html

 

Content structure on Server B :  /content/siteB/store/*

 

Now we are planning to move some of the content  pages from Server A  "/content/siteA/home/*"  to Server B under store "/content/siteB/store/*". but we want to keep the url is same.

 

For example: we have page called 'abc' under /content/siteA/home/abc on Server A and this 'abc' page will be moved to server B under '/content/siteB/store/abc

Current URL of page is ' www.sitea.com/home/abc.html' so we want to keep the url remains same even though we move the page to Server B. Is this possible by writing some dispatcher rules? Please advise.

 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Andrei_Dantsou

Hello @sivas13911460,

You can use either the RewriteRule directive with the P flag (https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p) or the ProxyPass directive (https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass).
The ProxyPass, however, is preferable from the performance point of view. 

Regards

2 replies

Andrei_Dantsou
Andrei_DantsouAccepted solution
Level 3
December 28, 2020

Hello @sivas13911460,

You can use either the RewriteRule directive with the P flag (https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p) or the ProxyPass directive (https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass).
The ProxyPass, however, is preferable from the performance point of view. 

Regards

sivas13911460
December 28, 2020
Hi Andrei,
sivas13911460
December 28, 2020

Hi Andrei,

 

I've added below in my virtual hosts:
ProxyPreserveHost Off
ProxyPass "/store/" "www.siteb.com/home/"
ProxyPassReverse "/store/" "www.siteb.com/home/"

 

and when i hit the page : www.sitea.com/store/abc.html  it says:

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Andrei_Dantsou
Level 3
December 28, 2020

Hi @sivas13911460,

The exact path should be used with the ProxyPass:

 

ProxyPass "/store/abc.html" "http://www.siteb.com/home/abc.html"

 


Alternatively, if a regex is required, then the ProxyPassMatch directive should be considered https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassmatch

Regards