Vky Vky - 1 year ago 123
PHP Question

Cakephp : How to set my project url to my domain?

For example http://example.com/ is my domain and when I visit this, it will show cakephp framework home page with five green messages.
I have to type http://example.com/index.php/public/index to get to my project's home page

What should I do to get my project running on my domain's main url http://example.com/

I am using CakePHP 2.7.1

Thanks in advance

Answer Source

You can define a route in routes.php in Config Folder like this

   Router::connect('/', array('controller' => 'public', 'action' => 'index'));

This will redirect your main url to the desired controller

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download