Multiple V-hosts with serverpaths?

Author Message

Nicklas Lundgren

Sunday 18 January 2004 6:50:29 am

Hello,
I really would appreciate some help, regarding rewriterules for Apache.

I run three sites with ez 3.24 on the same server, using the same db.
When launching th sites, every site will get its own domain name. But until then, I use uri-matching to select between sites like:
localhost/index.php/site1
localhost/index.php/site2

However, the third site need multiple language support. And I have set up siteaccesses for this. So now I can reach the third site like this:
localhost/index.php/site3 for the swedish version and
localhost/index.php/site3_en for the english version.

To make the urls:s more intuitive, I want this to work:
localhost/index.php/site3/en for the english one.
And ultimately:
localhost/site3/en to work as well, without index.php.

When launching on the real server, I hope to get these URL:s to work:
www.site3.com for swedish pages and
www.site3.com/en for english pages.

Thats, it.
Has anyone done this before with rewriterules in Apache?

I would really appreciate any ideas on how to achieve this.

Regards,
Nicklas Lundgren

James Packham

Monday 19 January 2004 9:20:49 am

Hi, I think I understand you right.

Add entries for each of your domains like this:

<VirtualHost *:80>
<Directory /var/www/html/site3>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>
RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php
DocumentRoot /var/www/html/site3
ServerName www.site3.com
</Virtualhost>

The rewriting bit is the "RewriteEngine On" and "RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php" lines. This is whatever you want apache to assume, so in this example anything that comes in after www.site3.com will be rewritten as www.site3.com/index.php.

e.g. www.site3.com/en automatically becomes www.site3.com/index.php/en (although this won't appear in the user's browser). eZ Publish will do the rest of the translation, you can tell it how to respond to different incoming urls in /settings/override/site.ini.php.append (or whatever it was)

Hope this helps (this is all in the documentation by the way).

Regards,

James

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 09:57:14
Script start
Timing: Jan 19 2025 09:57:14
Module start 'layout'
Timing: Jan 19 2025 09:57:14
Module start 'content'
Timing: Jan 19 2025 09:57:15
Module end 'content'
Timing: Jan 19 2025 09:57:15
Script end

Main resources:

Total runtime1.0973 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 589.1797152.6250
Module start 'layout' 0.00730.0039 741.804739.4453
Module start 'content' 0.01131.0848 781.2500504.0859
Module end 'content' 1.09600.0013 1,285.33598.1563
Script end 1.0973  1,293.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3082160.0002
Check MTime0.00140.1280160.0001
Mysql Total
Database connection0.00140.125110.0014
Mysqli_queries1.040494.8108540.0193
Looping result0.00050.0473520.0000
Template Total1.058596.520.5292
Template load0.00190.173620.0010
Template processing1.056696.286520.5283
Template load and register function0.00020.020610.0002
states
state_id_array0.00100.088310.0010
state_identifier_array0.00100.091820.0005
Override
Cache load0.00160.1459430.0000
Sytem overhead
Fetch class attribute can translate value0.00060.053020.0003
Fetch class attribute name0.00090.083330.0003
XML
Image XML parsing0.00060.058520.0003
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00270.2486160.0002
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs