login community faq

Hello!

I have a site and domain set up here on Webfaction. I'd like the 'homepage' of the site (i.e. http://example.com/) to point to an external website. This isn't a problem, I can set the IP address/A Record to do that for me via Webfaction's control panel.

However, I'd then like to have certain URLs NOT go to the external site. For instance, the URLs "http://example.com/blog" and "http://example.com/shows" should point to an application I have running on Webfaction.

Is this even possible?

asked Apr 29 '12 at 13:24

Big%20Al's gravatar image

Big Al
1


Without a change in DNS, you can achieve this by adding the following to a .htaccess entry using a Static/CGI/PHP application.

1
2
3
4
RewriteEngine on
RewriteCond %{HTTP_HOST} mysite\.com [NC]
RewriteCond %{REQUEST_URI} ^/$
Rewriterule ^(.*)$ http://mysecondsite.com/ [L,R=301]

answered Apr 29 '12 at 13:53

timg's gravatar image

timg ♦♦
4864

edited Apr 29 '12 at 14:01

Wouldn't that forward a visitor to http://mysecondsite.com?

I am trying to make it so the user will appear to be in http://example.com. So: http://example.com = external site http://example.com/blog = local webfaction application http://example.com/shows = same local webfaction application

Would the .htaccess allow this?

(Apr 29 '12 at 15:22) Big Al Big%20Al's gravatar image

What you want is a proxy, this can be done with a rule like this ,

1
RewriteRule ^/(.*) http://mysecondsite.com/$1 [P,L]
(Apr 29 '12 at 17:35) johns ♦♦ johns's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
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

Tags:

×46
×27

Asked: Apr 29 '12 at 13:24

Seen: 423 times

Last updated: Apr 29 '12 at 17:35

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited