Forum Moderators: phranque

Message Too Old, No Replies

Sub-domain pointing, URL re-writing

Making functionality available at one location be available at another

         

stevej444

2:04 pm on Aug 16, 2007 (gmt 0)

10+ Year Member



Hi,
Wonder if someone can help.

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]

g1smd

5:09 pm on Aug 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can do this, but then you will have generated Duplicate Content - the same content at multiple URLs. That means that their URL might rank higher than yours for your own site.

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.

stevej444

5:20 pm on Aug 16, 2007 (gmt 0)

10+ Year Member



Hi g1smd,

Thanks for this. Yup, I'm aware of the dangers of duplicate content and the needs to robots management - I'm just having a total mental blank about what the rewrite syntax is .... derrr ... and could just do with a bit of help with that alone .....

Thanks,
S

jdMorgan

6:02 pm on Aug 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to reverse-proxy the requests on their server to yours.

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

g1smd

6:04 pm on Aug 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



and the other answer...

<meta name="robots" content="noindex">

stevej444

8:05 pm on Aug 16, 2007 (gmt 0)

10+ Year Member



Thanks all - very informative and very helpful. Thanks.

stevej444

8:20 pm on Aug 16, 2007 (gmt 0)

10+ Year Member



In fact I want to be a bit more responsive than that. Thanks very much, great answers, great help.

Terrific forum.