removing index.php

Author Message

Milan Gothe

Saturday 22 April 2006 7:25:24 am

Hey Guys!

Can you please help me in removing index.php?
I tried a lot but not working.Please give me method in easy way.

André R.

Saturday 22 April 2006 8:34:45 am

http://ez.no/community/forum/install_configuration/virtualhost_cannot_access_admin_site#msg98829
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/site_ini/siteaccesssettings
http://ez.no/community/forum/install_configuration/virtual_host_setup_please

the key thing to search for is virtualhost setup..

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Mark Marsiglio

Saturday 22 April 2006 12:28:48 pm

I usually do this with an .htaccess file

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

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Matthew Carroll

Sunday 23 April 2006 10:05:17 am

When I first set up an ez site after much head scratching, I ended up using a bash script with sed to search / replace every template's ezurl with ezroot. Then I found this setting:

[SiteAccessSettings]
ForceVirtualHost=true

...which can be added to your settings/override/site.ini.append.php. This removes the index.php entirely from ezurl, but still allows url-based siteaccess selection to work.

Good luck
Matthew

http://carroll.org.uk

Bertrand Dunogier

Monday 24 April 2006 2:07:00 am

It should never be necessary to change ezurl to ezroot...

Adding the rewrite rules to the Virtual Host is usually enough.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Alexandre Cunha

Thursday 18 May 2006 12:32:23 am

It should never be necessary to change ezurl to ezroot...
Adding the rewrite rules to the Virtual Host is usually enough.

What are the rewrite rules you recommend to put "ForceVirtualHost=true" working ?
Assuming the user dont have access to apache configuration files but can define .htaccess

http://AlexandreCunha.com

Christian Johansen

Thursday 18 May 2006 12:52:27 am

This topic has surfaced several times. If I find the time I'll write a tutorial for removing index.php without virtual host setup soon... These are my rewrite-rules in .htaccess which allows me to use clean URLs without having access to httpd.conf:

RewriteEngine On

# Static cache
RewriteCond %{HTTP_HOST} ^(www\.)?myserver\.com$ [NC]
RewriteCond /dir/to/ez/static/siteaccess/index.html -f
RewriteRule ^/$ static/siteaccess/index.html [L]

RewriteCond %{HTTP_HOST} ^(www\.)?myserver\.com$ [NC]
RewriteCond /dir/to/ez/static/siteaccess/index.html -f
RewriteRule ^$ static/siteaccess/index.html [L]

RewriteCond %{HTTP_HOST} ^(www\.)?myserver\.com$ [NC]
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteCond /dir/to/ez/static/siteaccess/$1/index.html -f
RewriteRule ^(.*)$ static/siteaccess/$1/index.html [L]

# eZ Publish access
RewriteCond %{HTTP_HOST} ^(www\.)?myserver\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/index\.php/siteaccess [NC]
RewriteCond %{REQUEST_URI} !^/design/ [NC]
RewriteCond %{REQUEST_URI} !^/var/ [NC]
RewriteCond %{REQUEST_URI} !^/static/ [NC]
RewriteCond %{REQUEST_URI} \.(gif|jpe?g|png|css|js|html|ico)|var(.+)storage.pdf(.+)\.pdf$
RewriteRule ^(.*)$ /index\.php/siteaccess/$1 [L]

If you don't use static cache, you just need the rewrite rules below # eZ Publish access. Remember to keep RewriteEngine On.

You can still use www.myserver.com/index.php/site_admin to access the admin interface,.

Chris Lan

Saturday 27 May 2006 1:14:46 am

Christian,

I support your idea of a short tutorial. In fact, I struggle to remove the index.php + plain. My site is setup on virtual host but I don't have access to the httconf.

Option 1

+ in settings/override/site.ini.append.php
- Forcevirtualhost=true in settings/override/site.ini.append.php
- MatchOrder=host

+ in htaccess
RewriteEngine On
RewriteRule !\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php

Result: no index.php, no plain but also NO ADMIN

Option 2

+ in settings/override/site.ini.append.php
- Forcevirtualhost=true in settings/override/site.ini.append.php
- MatchOrder=host; uri

+ in htaccess
RewriteEngine On
RewriteRule !\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php

Result: no index.php, admin site but also PLAIN

I understand why it happens but not how to fix it. I tried your solution but it does work, I have the complete url. May you did configure something?

Dreaming that someone will bring the solution one day because url with plain is quiet ugly and no access to admin is a nightmare.

Thanks. Chris

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