简体   繁体   中英

Home page is not loading without index.php in url, example.com/index.php

I am using cakephp , Now the home page shows a white blank screen when I load the root domain name eg: conia.net. But the page is loading when we add index.php to the url eg: conia.net/index.php. Please help me to resolve this.

Take a look at the apache documentation here , Directory index directive. Maybe you are on a host that doesn't allow you access to the main apache config, if so you could try to make a .htaccess file with this config inside.

You need to enable the mod_rewrite module in your domain, you can find this module in your httpd.conf .

Essentially, your domain is ignoring the .htaccess file. I would contact your host about this if you are using a shared hosting service.

CakePHP already makes use of a .htaccess file to properly route your application, but it's being ignored due to the server settings.

Try adding this line:

DirectoryIndex index.php

on top of your .htaccess. This will load /index.php by default when loading: http://example.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM