Get ride of index.php in URL

Author Message

Martin Kristiansen

Friday 12 August 2005 7:26:07 am

Does any one now how to get ride of - index.php - in the URL?

http://mydomain.com/index.php/corporate/news/latest_updates_from_us

So that the URL look like:

http://mydomain.com/corporate/news/latest_updates_from_us

Or even better! Get ride og both index.php and corporate, so that we get a nice and short URL like this:

http://mydomain.com/news/latest_updates_from_us

Martin

See if I am online
http://mystatus.skype.com/bigclassic/nettmedia

Dive it -Sail it - Blogg it - Its life!
http://frittliv.blogspot.com

Matthias Becker

Friday 12 August 2005 7:36:05 am

If you have access to the settings for your virtual host, you need to set it up as follows:

<VirtualHost *>
DocumentRoot /path/to/ezpublish
ServerName test.ez.local
<Directory /path/to/ezpublish>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>
RewriteEngine On
RewriteRule !\.(js|gif|css|jpg|png)$ /path/to/ezpublish/index.php
</VirtualHost>

The most important lines in this code are the rewrite statements at the end. If you have already a working virtualhost configuration, just add these two lines to it, rather than copying this whole setup. If you are able to override the settings for mod_rewrite in your htaccess files (check with your hosting provider), you can place a file called .htaccess containing the following lines in the root of your installation. This is the default name and what 99% of hosting providers use, but it pays to check first!

RewriteEngine On
RewriteRule !\.(js|gif|css|jpg|png)$ /path/to/ezpublish/index.php

Sam Wong

Sunday 20 November 2005 9:05:28 am

Hi Matthias,

Could you kindly tell me how and where to add this part?

<VirtualHost *>
DocumentRoot /path/to/ezpublish
ServerName test.ez.local
<Directory /path/to/ezpublish>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>
RewriteEngine On
RewriteRule !\.(js|gif|css|jpg|png)$ /path/to/ezpublish/index.php
</VirtualHost>

Gurudutt Verma

Monday 21 November 2005 4:35:05 am

Hi Martin

Have a look here if it is helpful to you,

http://ez.no/community/forum/install_configuration/remove_plain_in_url

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

eZ debug

Timing: Jan 18 2025 16:15:18
Script start
Timing: Jan 18 2025 16:15:18
Module start 'layout'
Timing: Jan 18 2025 16:15:18
Module start 'content'
Timing: Jan 18 2025 16:15:19
Module end 'content'
Timing: Jan 18 2025 16:15:19
Script end

Main resources:

Total runtime0.7413 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.0313152.6406
Module start 'layout' 0.00650.0039 740.671939.4766
Module start 'content' 0.01040.7293 780.1484620.4922
Module end 'content' 0.73980.0015 1,400.640612.1484
Script end 0.7413  1,412.7891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4528160.0002
Check MTime0.00140.1893160.0001
Mysql Total
Database connection0.00080.102710.0008
Mysqli_queries0.678091.4586640.0106
Looping result0.00060.0821620.0000
Template Total0.708995.620.3544
Template load0.00230.305820.0011
Template processing0.706695.317220.3533
Template load and register function0.00020.023110.0002
states
state_id_array0.00080.102010.0008
state_identifier_array0.00160.216320.0008
Override
Cache load0.00190.2573440.0000
Sytem overhead
Fetch class attribute can translate value0.00040.055740.0001
Fetch class attribute name0.00080.108560.0001
XML
Image XML parsing0.00250.340240.0006
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00230.3073220.0001
String conversion0.00000.001640.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs