WebFaction
Community site: login faq

Hi,

I have two domain fund.tracedig.com and price.tracedig.com, now I can redirect fund.tracedig.com to service.tracedig.com/fund/ and price.tracedig.com to service.tracedig.com/price/, But I need to make my users only see fund.tracedig.com and price.tracedig.com, not service.tracedig.com/xxx/

How can I configure that?

Thanks.

asked 26 Jan '11, 23:38

bear330
145
accept rate: 0%


Hi,

Depending on the type of application. You could mount the app at service.tracedig.com/fund/ also on fund.tracedig.com and the app on service.tracedig.com/price/ on price.tracedig.com

If these are just sub-directories, you could create them as symlink apps and mount them as explained above.

Hope that helps!

permanent link

answered 27 Jan '11, 00:26

neeravk
1.5k3412
accept rate: 41%

My application type is django. I don't know how to mount site to another application's path. service.tracedig.com mount service app. fund.tracedig.com -> service.tracedig.com/fund/ (it seems no way to do that in control panel...?)

(16 Feb '11, 00:52) bear330

You need to mount the app not the site that is at service.tracedig.com/fund on price.tracedig.com

and the app at service.tracedig.com/fund/ at fund.tracedig.com

If you mean to say that /fund and /price are routes in your Django Apps you will need to use the method below or break your app in to two apps that serve /fund and /price at root(i.e /) and then mount them at the above URLs.

Hope that helps!

(16 Feb '11, 01:25) neeravk

Also, depending on the application, you can do this using a Static/CGI/PHP application set up as a redirect, exactly as two instances of this redirection in one .htaccess file, except that you would use [P] (proxy) redirection instead of [R] redirection.

permanent link

answered 27 Jan '11, 00:54

ryans ♦♦
5.0k93360
accept rate: 43%

Thanks, I tried your solution, but I got 500 HTTP response, here is my .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^price.tracedig.com$ [NC]
RewriteRule ^(.*)$ http://service.tracedig.com/price/$1 [P,L]

Is that something wrong?

(09 Feb '11, 04:48) bear330

The 'ProxyRequests' and 'ProxyVia' lines are causing the trouble. These can only be used in httpd.conf files. They aren't needed in .htaccess files.

(09 Feb '11, 04:52) David L ♦♦

I removed these lines, but it did not work also. The log content:

2011/02/09 04:23:22 [info] 18950#0: *53092183 client closed prematurely connection, so upstream connection is closed too while sending request to upstream, client: 174.120.42.8, server: price.tracedig.com, request: "GET /price/price/price/price/price/price/price/price/price/price/price/ HTTP/1.1", upstream: "http://127.0.0.1:2480/price/price/price/price/price/price/price/price/price/price/price/", host: "price.tracedig.com"

I saw "/price/" repeatedly but I don't know what's wrong...:(

(10 Feb '11, 03:43) bear330

I'm not sure if you are still working on this, but you might take a look at: http://www.easymodrewrite.com/notes-last More specifically example 1, which indicates a situation I think relates here. Basically, the L flag to RewriteRule will run an additional request on the rewritten filename, causing a sort of recursion if you don't add a condition to handle it.

permanent link

answered 28 Feb '11, 02:16

jm7
1
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×128
×19
×7

question asked: 26 Jan '11, 23:38

question was seen: 3,128 times

last updated: 28 Feb '11, 02:16

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM