Forums / Install & configuration / How to use .htaccess to remove index.php from URL?

How to use .htaccess to remove index.php from URL?

Author Message

Eivind Marienborg

Friday 13 November 2009 1:35:58 am

Greetings!

I've spent hours trying the different approaches to removing index.php from the URL of the site, but now I give up, and hope someone braver and stronger than me might help.

I'm in a hosted environment, and don't have access to the httpd.conf (why doesn't the installation documentation offer help for this?).

I've added the ForceVirutalHost=true to override/site.ini.append.php, and copied .htaccess_root to .htaccess.

When accessing the root page everything's fine. But when trying to access subpages with index.php in the URL, I get an "Access forbidden" error.

I would greatly appriciate any help - either being pointed in the direction of a tutorial or documentation page, or suggestions on what to try.

Gaetano Giunta

Friday 13 November 2009 4:10:06 am

If you're using the stock .htaccess file from eZP install, you need to comment out the first 2 FilesMatch directives to make it work in 'vhost mode':

#<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>

This should have the exact same effect as uncommenting the 3rd configuration block, which is recommended by the comments within the .htaccess file itself...

Principal Consultant International Business
Member of the Community Project Board

Eivind Marienborg

Friday 13 November 2009 6:35:19 am

Thanks for your reply. Doing like you say removes the error messages, but if I try to access any page (without index.php in the URL), the home/root page is displayed.

So, one step forward, but I'm still not quite where I want to be.. :)

Rakshit Patel

Wednesday 23 December 2009 11:49:30 pm

Here is a solution to rmove index.,php from URLs. This works for me.

http://bit.ly/4nz3nZ

Rakshit Patel.
http://www.programmingfacts.com/