Forums / Install & configuration / Mod_Rewrite and siteaccess hell please help

Mod_Rewrite and siteaccess hell please help

Author Message

Dan C

Thursday 03 February 2005 12:27:10 pm

Hi,

I've just spend the last 5 hours searching the documentation and forums and I can't figure out a resolution to my problem. Here is my setup:

One site: http://www.example.com/

Code excerpts below

my current site.ini.append:

[SiteSettings]
DefaultAccess=homes
SiteList[]
SiteList[]=homes

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]
AvailableSiteAccessList[]=homes
AvailableSiteAccessList[]=homes_admin
MatchOrder=uri
HostMatchMapItems[]

siteaccess/homes/site.ini.append AND siteaccess/homes_admin/site.ini.append

[SiteSettings]
SiteName=Mike Koszo
SiteURL=koszo.darpa.org/index.php
LoginPage=embedded

Now, this *used* to work, and i could go to urls like:
http://www.example.com/index.php/homes/
http://www.example.com/index.php/homes/etc
http://www.example.com/index.php/homes_admin/

I then added into my httpd.conf:

RewriteEngine On
RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php

and it seems to be working fine.

Now, when i try and change my settings/override/site.ini.append to:

[SiteSettings]
DefaultAccess=homes
SiteList[]
SiteList[]=homes

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]
AvailableSiteAccessList[]=homes
AvailableSiteAccessList[]=homes_admin
MatchOrder=host
HostMatchType=map
HostMatchMapItems[]=koszo.darpa.org;homes
HostMatchMapItems[]=www.koszo.darpa.org;homes
HostMatchMapItems[]=admin.koszo.darpa.org;homes_admin

Direct urls will now work, ie:
http://www.example.com/etc
http://admin.example.com/
BUT
urls like:
http://www.example.com/index.php/homes/etc
or
http://admin.example.com/index.php/homes_admin/
will NOT work. This unfortunately breaks most of the controls in the admin, and breaks a lot of links inside my content. Also for some other reason, I was unable to load jpg/gifs etc...

Now... I've gone back to my original setup, and now I can not login to the admin system.
when I go to http://www.example.com/index.php/homes_admin/ it loads fine, but the form tries to post to "/user/login" and then redirects me to "/" and it logs me into the /homes/ siteaccess instead of the homes_admin siteacess.

I've tried clearing the cache (./bin/shell/clear-cache.sh --clear-all) multiple times but this has not helped.

Does anyone know what I'm doing wrong? Any help would be greatly appreciated. Ideally I would like to have the second setup working with all the following urls working:

http://www.example.com/
http://admin.example.com/
http://www.example.com/index.php/homes/
http://admin.example.com/index.php/homes_admin/
http://www.example.com/homes/
http://admin.example.com/homes_admin/

Or perhaps there is a different way to clear admin cache? Anyhow, I hope someone can help.

Thanks,

Dan

Dan C

Thursday 03 February 2005 12:51:09 pm

it appears as though the /var/ directory is not all cleared out of cached files with clear-cache.sh utility. I had to manually delete some files in there before the admin would work again.

eZ debug

Timing: Jan 18 2025 04:57:31
Script start
Timing: Jan 18 2025 04:57:31
Module start 'content'
Timing: Jan 18 2025 04:57:32
Module end 'content'
Timing: Jan 18 2025 04:57:32
Script end

Main resources:

Total runtime0.9566 sec
Peak memory usage4,096.0000 KB
Database Queries189

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 587.9609180.8047
Module start 'content' 0.00810.7269 768.7656445.8047
Module end 'content' 0.73500.2215 1,214.5703333.7578
Script end 0.9565  1,548.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00490.5135210.0002
Check MTime0.00180.1883210.0001
Mysql Total
Database connection0.00180.184210.0018
Mysqli_queries0.863690.27731890.0046
Looping result0.00220.23151870.0000
Template Total0.900894.220.4504
Template load0.00230.243820.0012
Template processing0.898593.921820.4492
Template load and register function0.00020.021210.0002
states
state_id_array0.00610.635910.0061
state_identifier_array0.00140.145920.0007
Override
Cache load0.00190.2011440.0000
Sytem overhead
Fetch class attribute can translate value0.00150.160120.0008
Fetch class attribute name0.00200.207620.0010
XML
Image XML parsing0.00040.044920.0002
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.01401.4673210.0007
String conversion0.00000.000530.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/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs