Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove index.php from cakephp url

how to remove the index.php from the cakephp url? In order to access my forms folder, I have to give the url : http://localhost/cake_1_2/index.php/forms.

how do i remove that index.php?

I removed the .htaccess from the folders as mentioned in core.php and uncommented the App.baseUrl line. Yet,I'm not able to view the page without the index.php in the url.

like image 451
Angeline Avatar asked May 17 '26 12:05

Angeline


2 Answers

If you're using CakePHP with mod_rewrite on (to get pretty URL's) you can create new folders within WEBROOT and access files just fine.

Example:

Site/webroot/forms/form.php = http://www.sitename.com/forms/form.php

CakePHP's mod_rewrite is setup to check for existing files in WEBROOT and NOT pass them to index.php.

If you need to get up to folder outside of webroot you might consider playing with Symbolic links.

like image 111
Darren Newton Avatar answered May 21 '26 04:05

Darren Newton


Check the CakePHP Install guide section for mod_rewrite. Once enabled in Apache, the pretty URLs will just work. If you're not using Apache, you're stuck with ugly URLs.

like image 33
spoulson Avatar answered May 21 '26 04:05

spoulson