Forum Moderators: phranque
We have a couple of tools, say they are running at the http://www.example.com/useful-tools/ location. We have a client who would like to use them, but under one of their subdomains e,g, http://tools.quux-foo.com/.
Ideally they would like to 'point' http://tools.quux-foo.com/ at http://www.example.com/useful-tools/, and would like us to do some url-rewriting such that when a user visits http://tools.quux-foo.com/ they access the functionality at http://www.example.com/useful-tools/ but the URLs in the users browsers address bar keeps using the http://tools.quux-foo.com/ sub-domain. In short - the general user thinks they are using tools on the http://tools.quux-foo.com/ sub-domain, and know nothing whatsoever about http://www.example.com/useful-tools/.
This is running Linux/Apache, so all mod_rewrite options are available - would be implemented using .htaccess files.
So - I have two queries:
1. Any suggestions as to the mod_rewrite syntax here for the .htaccess most welcome.
2. Is this actually a wise thing to do? Is it dodgy in anyway - is this spoofing? Will this have any negative SEO impact?
Thanks,
S
[edited by: jdMorgan at 5:55 pm (utc) on Aug. 16, 2007]
[edit reason] Obscured domains per TOS. [/edit]
If you do this, I would make sure that the pages dynamically return a <meta name="robots" content="noindex"> tag on their copy of the page so that only your copy gets to be indexed by search engines.
You would use a rewrite so that a request for URL A pulls content from filepath B on the server. It is just one or two lines of code, but must be used with extreme caution.
This would involve them setting up the reverse proxy using mod_proxy in their server config file, or using the [P] flag of mod_rewrite in their "phantom" tools directory.
They must be advised to NOT set up or enable a forward proxy, as this would represent a security threat to their operations. Only a reverse proxy is required.
The effect is that your server will appear as part of their server's filespace, although your 'files' will be accessed via HTTP. For this reason, you will want to filter and limit the areas of your server that can be accessed from their server's IP address. Bringing up another point: You will see all requests coming from their server, and will not be able to see the IP or hostname of the actual requesting client unless you get them to take steps to append that information to the URL, for example, as a query string that you can extract for use in using a custom log file format on your server.
See Apache mod_proxy, mod_rewrite (RewriteRule [P] flag) and mod_log_config.
Jim