【问题标题】:How to correct config Apache and Codeigniter?如何更正配置 Apache 和 Codeigniter?
【发布时间】:2015-10-22 01:53:25
【问题描述】:

我正在使用 Apache + Codeigniter 设置 RESTful 后端服务。

我将 codeigniter 的项目文件夹 html/ 放在我的 Apache 的 web 文件夹下。 然后我可以通过http://localhost/html/index.php 访问它。 我想删除我网址中的文件夹名称,像http://localhost/index.php那样访问我的网站。

谁能告诉我如何在 Apache 端或 Codeigniter 上进行配置?

提前致谢!

【问题讨论】:

    标签: php apache codeigniter


    【解决方案1】:

    在 Apache 文件夹中,打开文件名httpd.conf 并将这段代码放在底部:

    Listen 80
    <VirtualHost *:80>
         DocumentRoot "D:/htdocs/html/"
    </VirtualHost>
    

    告诉我,如果它有效。

    【讨论】:

    • 我试过了,这很有效。但发现另一个问题,我的网络的所有图像都无法显示。似乎图像的位置效果不佳。你有什么想法吗?
    • 我的错,图片不显示导致 Codeigniter 的 $config['base_url'] 仍然有 html/ 路径。从我的 $config['base_url'] 中删除 html/ 后一切正常。
    猜你喜欢
    • 2016-09-17
    • 2020-06-27
    • 1970-01-01
    • 2011-04-16
    • 1970-01-01
    • 2011-03-11
    • 2012-05-25
    • 2021-06-10
    • 2012-03-10
    相关资源
    最近更新 更多