Forums / Setup & design / Multiple V-hosts with serverpaths?

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

eZ debug

Timing: Jan 19 2025 07:27:11
Script start
Timing: Jan 19 2025 07:27:11
Module start 'content'
Timing: Jan 19 2025 07:27:11
Module end 'content'
Timing: Jan 19 2025 07:27:12
Script end

Main resources:

Total runtime0.9295 sec
Peak memory usage4,096.0000 KB
Database Queries191

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 590.0938180.8281
Module start 'content' 0.00680.7545 770.9219509.1641
Module end 'content' 0.76130.1682 1,280.0859332.7734
Script end 0.9295  1,612.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4318210.0002
Check MTime0.00150.1648210.0001
Mysql Total
Database connection0.00080.091110.0008
Mysqli_queries0.850791.51621910.0045
Looping result0.00250.27151890.0000
Template Total0.900496.920.4502
Template load0.00200.210020.0010
Template processing0.898596.658720.4492
Template load and register function0.00020.020810.0002
states
state_id_array0.00190.203410.0019
state_identifier_array0.00160.172120.0008
Override
Cache load0.00170.1839430.0000
Sytem overhead
Fetch class attribute can translate value0.00140.155830.0005
Fetch class attribute name0.00140.148630.0005
XML
Image XML parsing0.00120.129130.0004
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00230.2461270.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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