WebFaction
Community site: login faq

(I was going to ask a question, but finally grokked this and thought it might help someone in the future.)

I have two applications:

  1. ~/webapps/phpapp, which includes a docroot subdirectory, i.e. ~/webapps/phpapp/docroot
  2. ~/webapps/symapp, which links directly to the docroot subdirectory above.

phpapp redirects all incoming urls to docroot/dispatch.php, which takes different actions based on the urlpath.

I'd like to link symapp to two different websites:

  • top.mydom.us/
  • tree.mydom.us/twig/

top.mydom.us/ worked fine, but tree.mydom.us/twig/ required adding a RewriteBase statement to ~/webapps/phpapp/.htaccess, which of course then broke top.mydom.us/

After consulting the link below, I've gotten this to work

RewriteEngine On
 # RewriteBase equivalent - for top.mydom.us (and any other site aside from tree.mydom.us)
 RewriteCond %{HTTP_HOST} !^tree.mydom.us$
 RewriteRule . - [E=REWRITEBASE:/]

 # RewriteBase equivalent - for tree.mydom.us/twig/
 RewriteCond %{HTTP_HOST} ^tree.mydom.us$
 RewriteRule . - [E=REWRITEBASE:/twig/]

 RewriteCond %{REQUEST_URI} !dispatch\.php$
 RewriteRule ^(.*)$ %{ENV:REWRITEBASE}dispatch.php [L,QSA]

asked 23 Apr '12, 22:30

cesnn
93513
accept rate: 14%

edited 23 Apr '12, 22:32


Thank you for sharing your results with the community.

permanent link

answered 23 Apr '12, 22:42

johns
5.4k312
accept rate: 23%

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:

×75
×28
×15
×6
×2

question asked: 23 Apr '12, 22:30

question was seen: 8,803 times

last updated: 23 Apr '12, 22:42

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