Forums / Install & configuration / Get ride of index.php in URL

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