Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-18663

index.php controller should handle RemoveSiteAccessIfDefaultAccess

    XMLWordPrintable

Details

    Description

      I have in my site.ini:
      [SiteSettings]
      DefaultAccess=en

      [SiteAccessSettings]
      RemoveSiteAccessIfDefaultAccess=enabled

      As a result, as expected, the siteAccess is not included in the url when I surf on the default siteAccess

      However if I type by hand the url: http://www.domain.com/en/my-link, the link is correct, I'm not redirected.
      As a result, I'm on an URL where the default siteAccess is included, it's not removed as asked by RemoveSiteAccessIfDefaultAccess=enabled

      index.php should perform a redirect to the url:
      http://www.domain.com/my-link

      For now, I've added a crappy patch in my index.php to correct this bad behavior, waiting for a better solution...

      at around line 340, after the code:

      $access = eZSiteAccess::match( $uri,
                            eZSys::hostname(),
                            eZSys::serverPort(),
                            eZSys::indexFile() );
      $access = eZSiteAccess::change( $access );
      eZDebugSetting::writeDebug( 'kernel-siteaccess', $access, 'current siteaccess' );
      

      I've added the code:

      if ( $ini->variable( 'SiteAccessSettings', 'RemoveSiteAccessIfDefaultAccess' ) == "enabled" &&
           $access["name"] == $ini->variable( 'SiteSettings', 'DefaultAccess' ) &&
           !empty($access["uri_part"]) )
      {
          $redir = $uri->attribute("original_uri");
          eZURI::transformURI($redir);
          eZHTTPTool::redirect($redir);
          eZExecution::cleanExit();
      }
      

      Attachments

        Activity

          People

            unknown unknown
            enzo enzo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: