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.

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