how to configure the htaccess file for the rewrite rule ?

Author Message

Mike Kent

Wednesday 06 January 2010 10:32:52 am

hi, i'm a newbie for ez publish system.

i wanto know how to configure the htaccess file to remove the index.php? in the url ?

who can tell me a right file. tks.

my ez publish version is 4.2.

there is my htaccess file below:

# Copy this file to a new file called .htaccess in your eZ Publish root
# to make the site more secure in non-virtualhost mode (index.php used in urls).
#
<FilesMatch ".">
order allow,deny
deny from all
</FilesMatch>
<FilesMatch "(^index\.php|favicon\.ico|index_treemenu\.php|\.(gif|jpe?g?|png|css|js|swf|html?)|var(.+)storage.pdf(.+)\.pdf)$">
order allow,deny
allow from all
</FilesMatch>
# If you see "Forbidden" when trying to access root page of your site
# without 'index.php' appended, uncomment the following "Files" section.
# NOTE: replace "ezpublish-4.1.0" with base name of the directory
# where your eZ Publish intallation resides.
# e.g. base name of "/sites/ezpublish/ezpublish-4.1.0" is "ezpublish-4.1.0".
#<Files "ezpublish-4.1.0">
# order allow,deny
# allow from all
#</Files>
RewriteEngine On
# Allow access to the index_treemenu.php file for a faster admin interface
RewriteRule content/treemenu/? index_treemenu.php
RewriteRule ^index_treemenu\.php - [L]
# Uncomment the line below if you placed your favicon at the root of your
# eZ Publish instance. It will then be served directly.
#RewriteRule ^favicon\.ico - [L]
# Uncomment the line below if you want you favicon be served from the standard design.
# You can customize the path to favicon.ico by replacing design/standard/images/favicon.ico
# by the adequate path.
#RewriteRule ^favicon.ico design/standard/images/favicon.ico [L]
RewriteRule ^design/standard/images/favicon\.ico - [L]
# Uncomment the line below once you set up the right robots.txt file
# In that case remember to also modify the FilesMatch rule abov
# More info here http://en.wikipedia.org/wiki/Robots.txt
#RewriteRule ^robots\.txt - [L]
# Uncomment the line below in case you are using
# Platform for Privacy Preferences Project ( P3P ) related files.
# In that case remember to also modify the FilesMatch rule above
# More info here : http://en.wikipedia.org/wiki/P3p
#RewriteRule ^p3p/(.+)\.xml - [L]
RewriteRule !(\.(gif|jpe?g?|png|css|js|swf|html?)|var(.+)storage.pdf(.+)\.pdf)$ index.php
DirectoryIndex index.php

how can i modify it ?

Pablo Pernot

Thursday 07 January 2010 12:12:55 am

Did you have a look there : http://ez.no/doc/ez_publish/technical_manual/3_10/installation/virtual_host_setup

Pablo Pernot
http://www.smartview.fr
http://www.areyouagile.com

Nicolas Pastorino

Monday 01 February 2010 8:57:22 am

Hi Mike and welcome aboard !

Have you considered using a Virtual Host setup ? This will make the removal of index.php easier. Pablo gave you a useful resource right above.

Let us know,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

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 05:12:26
Script start
Timing: Jan 18 2025 05:12:26
Module start 'layout'
Timing: Jan 18 2025 05:12:26
Module start 'content'
Timing: Jan 18 2025 05:12:26
Module end 'content'
Timing: Jan 18 2025 05:12:26
Script end

Main resources:

Total runtime0.7589 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1953152.6563
Module start 'layout' 0.00570.0032 740.851639.4922
Module start 'content' 0.00900.7487 780.3438591.0078
Module end 'content' 0.75770.0012 1,371.351612.0938
Script end 0.7589  1,383.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4323160.0002
Check MTime0.00130.1696160.0001
Mysql Total
Database connection0.00100.136510.0010
Mysqli_queries0.698291.9957590.0118
Looping result0.00060.0798570.0000
Template Total0.730196.220.3651
Template load0.00230.305820.0012
Template processing0.727895.897920.3639
Template load and register function0.00020.029510.0002
states
state_id_array0.00070.094910.0007
state_identifier_array0.00070.093820.0004
Override
Cache load0.00200.2655610.0000
Sytem overhead
Fetch class attribute can translate value0.00120.163130.0004
Fetch class attribute name0.00180.232050.0004
XML
Image XML parsing0.00110.142630.0004
class_abstraction
Instantiating content class attribute0.00000.001550.0000
General
dbfile0.00090.1220220.0000
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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs