Codeigniter Remove directory from url

2019-10-03 15:22发布

问题:

I have a following domain name :- http://educonnects.com/jCat/profile/recruiter_profile

I am using codeigniter framework. And i want my domain name could be :-

http://educonnects.com/profile/recruiter_profile

Jcat is the project name where codeigniter has been installed.

Please help, i am new in codeigniter.

回答1:

Add .htaccess file in your folder

You set default route controller name in 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>  

(OR)

You can set subversion in apache httpd.conf file. You will find out how to set subversion