WebFaction
Community site: login 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 29 Apr '12, 13:24

Big Al
111
accept rate: 0%


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

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

answered 29 Apr '12, 13:53

timg ♦♦
1.3k4
accept rate: 30%

edited 29 Apr '12, 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?

(29 Apr '12, 15:22) Big Al

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

RewriteRule ^/(.*) http://mysecondsite.com/$1 [P,L]
(29 Apr '12, 17:35) johns
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:

×76
×32

question asked: 29 Apr '12, 13:24

question was seen: 2,816 times

last updated: 29 Apr '12, 17:35

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