删除的index.php codeigniter [英] remove index.php codeigniter

查看:161
本文介绍了删除的index.php codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实在无法找到一个办法让我的.htaccess工作,消除/index.php/部分从我的本地网站的网址的http://本地主机/ci_intro/index.php/home /

从XAMPP / xamppfiles / htdocs中/ ci_intro /应用/配置/ routes.php文件

  $航线['default_controller'] ='家';
$路线['404_override'] ='';
 

这是XAMPP / xamppfiles / htdocs中/ ci_intro /应用/配置/ 的config.php

  $配置['BASE_URL'] ='的http://本地主机/ ci_intro /';
$配置['index_page'] ='';
$配置['uri_protocol'] ='自动';
 

这是XAMPP / xamppfiles的/ etc / 的httpd.conf

 的LoadModule rewrite_module模块/ mod_rewrite.so

 ...

<目录/应用程序/ XAMPP / xamppfiles / htdocs目录>
    选择指标的FollowSymLinks ExecCGI包括
    设置AllowOverride所有
    要求所有批准
< /目录>
 

mod_rewrite.so是工作,我曾与一个phpinfo()函数检查的话...

这是XAMPP / xamppfiles / htdocs中/ ci_intro / 的.htaccess

 < IfModule mod_rewrite.c>
    RewriteEngine叙述上
    的RewriteBase / ci_intro /

    的RewriteCond%{REQUEST_URI} ^系统。*
    重写规则^(。*)$ /index.php?/$1 [L]

    的RewriteCond%{REQUEST_URI} ^应用。*
    重写规则^(。*)$ /index.php?/$1 [L]

    的RewriteCond%{} REQUEST_FILENAME!-f
    的RewriteCond%{} REQUEST_FILENAME!-d
    重写规则^(。*)$的index.php?/ $ 1 [L]
< / IfModule>

<!IfModule mod_rewrite.c>
    的ErrorDocument 404的index.php
< / IfModule>
 

任何想法? 请我真的需要帮助这里,非常感谢!

解决方案

  RewriteEngine叙述上
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^(。*)$的index.php / $ 1 [L]
 

在你的htaccess
写 检查此链接以启用mod_rewrite的功能 的Apache设置

I really can't find a way to make my .htaccess work and eliminate the /index.php/ part from my localhost site's url: http://localhost/ci_intro/index.php/home/

From XAMPP/xamppfiles/htdocs/ci_intro/application/config/ routes.php :

$route['default_controller'] = 'home';
$route['404_override'] = '';

from XAMPP/xamppfiles/htdocs/ci_intro/application/config/ config.php :

$config['base_url'] = 'http://localhost/ci_intro/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';

from XAMPP/xamppfiles/etc/ httpd.conf :

LoadModule rewrite_module modules/mod_rewrite.so

 ...

<Directory "/Applications/XAMPP/xamppfiles/htdocs">
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Require all granted
</Directory>

mod_rewrite.so is working, I've checked it with a phpinfo()...

from XAMPP/xamppfiles/htdocs/ci_intro/ .htaccess :

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /ci_intro/

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

Any ideas? Please I really need help here, thanks!

解决方案

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L] 

write this in your htaccess
check this link to enable mod_rewrite function of apache setting

这篇关于删除的index.php codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆