[TYPO3] htaccess rewrite for multiple installations on one core

Luc Franken typo3 at tentoday.com
Wed Apr 26 15:39:32 CEST 2006


Allright, I have been testing and I think I have a fully functional 
thing now:

To explain:
Part 1: Rewrites traffic to: test.detijdoisterwijk.nl to subfolder detijd.

Part 2: Rewrites traffic to: test.oisterwijksculptuur.nl to subfolder 
sculptuur.

Part 3: The default RealURL configuration which I need for all my sites.

******Important note*******
Do not forget the [L] things, they will mess up everything and create 
strange error because multiple rules get applied.

I hope this helps other people too! If someone has improvements please 
post them! I am currently thinking for some way to make this file based 
on a table in a database to make the management much easier...


RewriteEngine On
RewriteCond %{HTTP_HOST} ^test.detijdoisterwijk.nl$
RewriteCond %{REQUEST_URI} !^/detijd/
RewriteRule (.*) /detijd/$1 [L]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^test.oisterwijksculptuur.nl$
RewriteCond %{REQUEST_URI} !^/sculptuur/
RewriteRule (.*) /sculptuur/$1 [L]

RewriteEngine On
RewriteRule ^typo3$ - [L]
RewriteRule ^typo3/.*$ - [L]
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php


Luc Franken schreef:
> That's a very interesting post! Although this is not concrete Typo3 it 
> is something which is a problem for almost anybody who hosts multiple 
> websites one one account I think?
> 
> I already found that document but I had really no clue where to start. 
> If I understand it correctly this redirects *all* traffic from 
> http://domain.com to http://domain.com/domain/ ?
> 
> Thanks for your info!
> 
> Christian Vetter schreef:
>> Hi Luc,
>> Man, are you lucky - I happened to read your question, and here it is, 
>> the most comprehensive documentation of mod_rewrite (also known as the 
>> documentation of mod_rewrite), even in three different flavours:
>>  - for Apache 1.3: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
>>  - for Apache 2.0: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
>>  - for Apache 2.2: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>> There you will find anything you might want to know about all the 
>> fancy things you can do with that neat and powerful module.
>> But although I'm not really a guru of any kind, I have even more than 
>> bitter (yet helpful) sarcasm - I can also give you:
>>  1. hints:
>>     a. you will need server variables
>>     b. your want to know the host
>>  2. practical help (yummy, eh ;) but untested - that's up to you) :
>> [htaccess]
>> RewriteEngine on
>>     RewriteCond %{HTTP_HOST} !domain.com
>>     RewriteCond %{HTTP_HOST} (.*).com$
>> RewriteRule ^(.*)$ /%1$1
>> [/htaccess]
>> Hope that helps,
>> Christian
>>
>> PS: this here is a typo3 mailing list ;)
>>
>>
>> Am 19.04.2006, 21:39 Uhr, schrieb Luc Franken <typo3 at tentoday.com>:
>>
>>> Hello Typo3 and server guru's,
>>>
>>> I have a question regarding installing multiple installations on one
>>> shared hosting account. I have already running one installation with 30+
>>> domains. The performance is not very great so I want to seperate the
>>> biggest sites into seperate installs with symlinks etcetera.
>>>
>>> I managed to get the installation working. So now I have something like:
>>>
>>> http://domain.com/site1/index.php
>>> http://domain.com/site2/index.php
>>>
>>> These sites use the same core and it works great. Now I want to get them
>>> working nicely bij calling them like:
>>>
>>> http://site1.com/
>>> http://site2.com/
>>>
>>> And that is the problem. How can I write an htaccess file which
>>> understands that it should rewrite everything from domain site1 to
>>> subfolder site1?
>>>
>>> Also links to good documentation is really appreaciated!
>>>
>>> Thanks in advance for your time!
>>>
>>> Best Regards,
>>>
>>> Luc Franken
>>> TenToday development



More information about the TYPO3-english mailing list