删除index.php代码符号 [英] remove index.php codeigniter

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

问题描述

我真的找不到一个方法来使我的.htaccess工作,并从我的localhost网站的 url 删除/index.php/部分: http:// localhost /ci_intro/index.php/home/



来自XAMPP / xamppfiles / htdocs / ci_intro / application / config / routes.php

  $ route ['default_controller'] ='home'; 
$ route ['404_override'] =''; XAMPP / xamppfiles / htdocs / ci_intro / application / config / config.php 中的



  $ config ['base_url'] ='http:// localhost / ci_intro /'; 
$ config ['index_page'] ='';
$ config ['uri_protocol'] ='AUTO'; XAMPP / xamppfiles / etc / httpd.conf 中的

  LoadModule rewrite_module modules / mod_rewrite.so 

...

< Directory / Applications / XAMPP / xamppfiles / htdocs>
选项索引FollowSymLinks ExecCGI包括
AllowOverride所有
需要所有授予
< / Directory>



mod_rewrite.so正在工作,我已经用phpinfo XAMPP / xamppfiles / htdocs / ci_intro / .htaccess 中的p>

 < 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>

任何想法?
请在这里真的需要帮助,谢谢!

解决方案

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

在您的htaccessework中写这个
选中此链接以启用
的mod_rewrite功能安装设置


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代码符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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