删除index.php代码符号

编程入门 行业动态 更新时间:2024-10-22 13:51:14
本文介绍了删除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: 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'] = '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代码符号

本文发布于:2023-10-31 18:52:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546970.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:符号   代码   index   php

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!