【问题标题】:Codeigniter Remove directory from urlCodeigniter 从 url 中删除目录
【发布时间】:2013-10-01 12:20:58
【问题描述】:

我有以下域名:- http://educonnects.com/jCat/profile/recruiter_profile

我正在使用 codeigniter 框架。 我希望我的域名可以是:-

http://educonnects.com/profile/recruiter_profile

Jcat 是安装了 codeigniter 的项目名称。

请帮忙,我是 codeigniter 的新手。

【问题讨论】:

    标签: php codeigniter


    【解决方案1】:

    在您的文件夹中添加 .htaccess 文件

    您在 application/config/route.php 中设置默认路由控制器名称

             <IfModule mod_rewrite.c>
                RewriteEngine On
                RewriteBase /educonnects.com
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule ^(.*)$ index.php/$1 [L]
            </IfModule>
    
            <IfModule !mod_rewrite.c>
                ErrorDocument 404 /index.php
            </IfModule>  
    

    (或)

    您可以在 apache httpd.conf 文件中设置颠覆。 你会发现如何设置颠覆

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-18
      • 2013-09-11
      • 2013-07-15
      • 2016-05-14
      • 2014-10-28
      • 2012-06-15
      • 2012-09-21
      相关资源
      最近更新 更多