: Show content from one free host at the URL of another free host I have two free domains hosted by different services eg. GoodURL.BadFeatures.com and BadURL.GoodFeatures.com What is a way to display
I have two free domains hosted by different services
eg. GoodURL.BadFeatures.com and BadURL.GoodFeatures.com
What is a way to display the good URL in the browser but loading from the bad URL site?
At first, I was thinking of using a full page iframe but that would make it hard for normal users to share the page they are viewing (and cannot bookmark any pages they are viewing).
Then I thought maybe I can have GoodURL.BadFeatures.com request the content from BadURL.GoodFeatures.com and give only its output
(but since some users may want to log in, I need to forward all cookies - not sure how on a per user basis)
I tried placing the following in a .htaccess on the Good URL site:
RewriteEngine On
RewriteRule ^(.*) BadURL.GoodFeatures.com/ [P,L]
but keep getting Internal Error (500)
More posts by @Dunderdale272
1 Comments
Sorted by latest first Latest Oldest Best
The solution you're looking at is a proxy pass.
Your current method should be:
RewriteEngine On
RewriteRule ^(.*)$ BadURL.GoodFeatures.com/ [P]
Notice the '$' sign that captures the path to rewrite it. The proxy flag on mod_rewrite also skips the 'L' flag, as it's already passed the request onto mod_proxy and is ignoring all rules after processing that request.
A better method would be:
<VirtualHost *:80>
DocumentRoot "/www/whatever"
ServerName GoodURL.BadFeatures.com
ProxyPass BadURL.GoodFeatures.com/ ProxyPassReverse / BadURL.GoodFeatures.com/ ProxyPassReverseCookieDomain BadURL.GoodFeatures.com GoodURL.BadFeatures.com
</VirtualHost>
Using ProxyPass is preferred to rewriting due to the heavy amount of processing incurred with your current method of rewriting. This does the same thing but skips some steps and has better handling. It also solves your problem with Cookies.
I assume you're trying to combine a good hosting service with a good content manager - if it's possible to combine these onto a single server, it would greatly improve performance across the board. What you've set up here is known as a Gateway - having one server handle all requests while another focuses on content. Normally this setup has security features implemented to prevent tampering. Consider looking up options to implement this.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.