[英]Codeigniter - making page inside folder index
I have a folder called acc
in the controllers. 我在控制器中有一个名为
acc
的文件夹。 In the acc
folder I have a controller named acc
. 在
acc
文件夹中,我有一个名为acc
的控制器。 I'm a bit confused, as at the minute when you vist the site, you have to visit; 我有点困惑,因为当您访问该站点的那一刻,您必须访问; http://exampl.com/acc/acc .
http://exampl.com/acc/acc 。 How would I make it so that the user just has to visit http://example.com/acc , but without moving the acc PHP controller outside the acc folder.
我该怎么做,以便用户只需访问http://example.com/acc ,而无需将acc PHP控制器移到acc文件夹之外。
Sorry if it seems confusing, not sure how else to word it! 抱歉,如果看起来令人困惑,不知道该怎么说呢!
在config/routes.php
:
$route['acc'] = 'acc/acc/index';
How about adding an index.php file inside http://example.com/acc with the following content: 如何在http://example.com/acc内添加具有以下内容的index.php文件:
<?php
require_once ('acc/index.php');
?>
It might suit your needs. 它可能适合您的需求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.