shine_victim Posted June 19, 2019 Share Posted June 19, 2019 Good day to all Neowinians! I have a query regarding htaccess but unfortunately my htaccess knowledge is as strong as my ability to speak Latin (zero)! I have a requirement to serve content from SiteB whilst keeping the URL as SiteA. I will try and outline as this as well I can. Scenario Main site sits at www.SiteA.com (Wordpress site) Customer also has a Magento site hosted on the same server under a separate URL/account (purchase.SiteB.com) Customer "needs" to serve the purchase.SiteB.com site/content when a visitor visits www.SiteA.com/purchase Here is my poor attempt of trying to engineer this myself so please, go easy on me, htaccess is not a strong point at all for me: SiteA.com htaccess entry RewriteCond %{REQUEST_URI} ^/purchase/(.+) RewriteRule ^ https://purchase.SiteB.com/%1 [L,P] purchase.SiteB.com htaccess entry RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/(.+) [OR,NC] RewriteRule ^ /%1 [L,P] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Any tips and advice would be greatly appreciated heroes! Thanks in advance! Link to comment https://www.neowin.net/forum/topic/1383977-htaccess-redirect-users-to-another-site-whilst-keeping-url-the-same/ Share on other sites More sharing options...
Question
shine_victim
Good day to all Neowinians!
I have a query regarding htaccess but unfortunately my htaccess knowledge is as strong as my ability to speak Latin (zero)!
I have a requirement to serve content from SiteB whilst keeping the URL as SiteA. I will try and outline as this as well I can.
Scenario
Here is my poor attempt of trying to engineer this myself so please, go easy on me, htaccess is not a strong point at all for me:
SiteA.com htaccess entry
RewriteCond %{REQUEST_URI} ^/purchase/(.+)
RewriteRule ^ https://purchase.SiteB.com/%1 [L,P]
purchase.SiteB.com htaccess entry
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(.+) [OR,NC]
RewriteRule ^ /%1 [L,P]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Any tips and advice would be greatly appreciated heroes!
Thanks in advance!
Link to comment
https://www.neowin.net/forum/topic/1383977-htaccess-redirect-users-to-another-site-whilst-keeping-url-the-same/Share on other sites
0 answers to this question
Recommended Posts