0
votes

I want to remove the index.php from the url: http://mywebsite/index.php/. I m using CakePHP pretty URLs, I removed all the .htaccess files:

/.htaccess
/app/.htaccess
/app/webroot/.htaccess

and uncommented the App.baseUrl on the core.php.

Thank you for your help!

1
Why would you remove those files? That's exactly the opposite of what you need to do. book.cakephp.org/3.0/en/installation.html#url-rewriting - ndm
Thank you for your reply. it's because it was the only way that works for me. I've tried before to work with mod_rewrite but it doesn't work (only the home page worked). I will try again maybe I'm missing something. - Ninja
something like index.php is not how it should work out of the box. You should not need changes of htaccess. Check how to configure routes here: book.cakephp.org/3.0/en/development/routing.html - Tolga

1 Answers

0
votes

you can try this. i have been using this for my codeigniter and i think this will work for you too.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L,NC]

oh you dont want to use htaccess? . i misundestood your question.