Forums / Install & configuration / Get rid of siteaccess in default siteaccess
James Packham
Thursday 06 May 2004 2:07:44 am
Say I have two siteaccesses:
user (default)admin
Currently when I browse the <b>user</b> site I can access any page without the siteaccess in the url for example:
www.mydomain.com/aboutme gives the same result as www.mydomain.com/user/aboutme
However when I browse around the site all links include the siteaccess in the url - is there a way to get rid of this, without changing the siteaccess to host?
Thanks in advance,
James
Jan Borsodi
Tuesday 11 May 2004 12:04:59 am
There is no way without modifying the kernel code.
If you open the <i>access.php</i> file in an editor and look for the lines
if ( $access['type'] == EZ_ACCESS_TYPE_URI ) { include_once( 'lib/ezutils/classes/ezsys.php' ); eZSys::addAccessPath( $name ); }
If you change it to
if ( $access['type'] == EZ_ACCESS_TYPE_URI ) { $defaultAccess = $ini->variable( 'SiteSettings', 'DefaultAccess' ); if ( $access['name'] != $defaultAccess ) { include_once( 'lib/ezutils/classes/ezsys.php' ); eZSys::addAccessPath( $name ); } }
it might work.
-- Amos Documentation: http://ez.no/ez_publish/documentation FAQ: http://ez.no/ez_publish/documentation/faq
Tuesday 11 May 2004 2:13:58 am
Thanks Jan, but it didn't work :( Here's my output:
Parse error: parse error, expecting `T_VARIABLE' in /var/www/html/ezdir/access.php on line 47Fatal error: Call to undefined function: accesstype() in /var/www/html/ezdir/index.php on line 301
I tried playing around, by moving the ezsys.php into out of the new if, but didn't have any luck. I'll probably have a deeper look into this later on and see if there are any further hacks necessary. I think it's worth figuring out though, as a lot of us are on constrictive hosting packages, where it can be difficult to modfiy the DNS appropiately.
Regards,
Wednesday 12 May 2004 6:12:01 am
Are you sure you replaced just the lines I mentioned? The error message says that there is something wrong with the PHP code in access.php,perhaps there is a missing curly bracket (or one too many).