Wednesday 05 September 2007 2:37:00 pm
By default, eZ Publish URLs are constructed by using the domain name, then appending “index.php”, then appending the siteaccess name (which is often a language indicator), and finally appending the path to a specific node.
For more user-friendly URLs when using the URL site access configuration (used in our example as stated in the introduction*), you can remove the “index.php” from all addresses, provided that you are using the default mod_rewrite settings in your Apache .htaccess file and that mod_rewrite is enabled in your Apache httpd.conf file.
(*The URL site access configuration is the quickest and easiest site access configuration to set up, which is why it is used in this article. However, the virtual host site access configuration is recommended as the most secure option, as explained in the documentation. In the virtual site access configuration, each siteaccess can be assigned an individual hostname, such as admin.tennisdemo.ezsystems.ca for the admin siteaccess, and "index.php" is already omitted from the site-generated URLs.
In settings/override/site.ini.append.php, add the following code under the [SiteAccessSettings] block:
ForceVirtualHost=true
By default, eZ Publish URLs include a language indicator. To remove the language part of the URL for the default siteaccess, add the following code under the same [SiteAccessSettings] block:
RemoveSiteAccessIfDefaultAccess=enabled
Now, instead of http://tennisdemo.ezsystems.ca/index.php/eng/solutions as the address for a top-level page, it is http://tennisdemo.ezsystems.ca/solutions, which is much easier for visitors to remember.