Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm trying to use one install of Kohana to manage two separate sites rather than just duplicate the install. I have directories like this:

applications/
   app1/
   app2/

The .htaccess I have looks like this:

RewriteEngine on
RedirectMatch app1/(.*)$ http://app1.example.com/$1

RewriteCond %{REQUEST_FILENAME} !.*applications/app1.*
RewriteRule .* applications/app1/index.php/$0 [PT]

When I go to app1.example.com I get a 500 infinite redirect and the URL is app1.example.com/index.php/index.php/index.php/...

What I need is for it to look like it's going to app1.example.com but behind the scenes it is redirecting to document_root/applications/app1/index.php.

I also need this to work for app2 in the same way, but I imagine once I have it working for app1 it will essentially be identical.

If you want to throw in any tips on managing multiple sites with one Kohana install that would help too.

share|improve this question
    
Why do you have RedirectMatch in there? –  hakre Jun 19 '11 at 1:14
add comment

migrated from stackoverflow.com Jun 19 '11 at 21:26

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 1 down vote accepted

Looks like Kohana supports multiple sites from one installation, according to the docs:

http://docs.kohanaphp.com/installation

  1. Put the system folder somewhere on your server, preferably outside of your webserver's document root.

  2. Delete the system folder in your current application.

  3. For your application's index.php file, change the $kohana_system variable to the relative or absolute path of where you put the system folder.

  4. You can now point all of your applications to this one system folder for easy upgrades. This makes your life a whole lot easier when you have 10+ kohana sites on your server.

share|improve this answer
    
I don't see a kohana_system variable in index.php –  tandu Jun 19 '11 at 10:19
    
If you're using Kohana 3.x this tutorial will be more up to date: kohanaframework.org/3.1/guide/kohana/tutorials/sharing-kohana –  Lethargy Jun 22 '11 at 7:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.