Content Migration - Redirect URL with same hostname | Community
Skip to main content
sivas13911460
New Participant
Dec 28, 2020 10:46 AM UTC
Solved

Content Migration - Redirect URL with same hostname

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.
Andrei_Dantsou
Andrei_DantsouAccepted solution
Level 3
Dec 28, 2020 12:45 PM UTC

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

4 replies

sivas13911460
New Participant
Dec 28, 2020 2:22 PM UTC

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.

Translate
Andrei_Dantsou
Level 3
Dec 28, 2020 3:57 PM UTC

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

Translate
Andrei_Dantsou
Andrei_DantsouAccepted solution
Level 3
Dec 28, 2020 12:45 PM UTC

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

Translate
sivas13911460
New Participant
Dec 28, 2020 2:19 PM UTC
Hi Andrei,
Translate