[英]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. 我正在使用cakephp,现在,当我加载根域名(例如conia.net)时,主页显示白色空白屏幕。 But the page is loading when we add index.php to the url eg: conia.net/index.php. 但是,当我们将index.php添加到URL时,页面正在加载,例如:conia.net/index.php。 Please help me to resolve this. 请帮助我解决此问题。
Take a look at the apache documentation here , Directory index directive. 看看这里的apache文档,目录索引指令。 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. 也许您所在的主机不允许您访问主apache配置,如果这样,您可以尝试使用此配置创建一个.htaccess
文件。
You need to enable the mod_rewrite module in your domain, you can find this module in your httpd.conf . 您需要在您的域中启用mod_rewrite模块,您可以在httpd.conf中找到该模块。
Essentially, your domain is ignoring the .htaccess file. 本质上,您的域将忽略.htaccess文件。 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. CakePHP已经使用.htaccess文件正确路由了您的应用程序,但是由于服务器设置而被忽略。
Try adding this line: 尝试添加以下行:
DirectoryIndex index.php
on top of your .htaccess. 在您的.htaccess之上。 This will load /index.php
by default when loading: http://example.com/
这将加载/index.php
默认情况下,当负载: http://example.com/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.