codeIgniter子域文件夹,删除从地址的index.php

编程入门 行业动态 更新时间:2024-10-21 23:07:12
本文介绍了codeIgniter子域文件夹,删除从地址的index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

所以,我想使用本手册从地址中删除的index.php: HTTP ://dev.lohv.eu/1/user_guide/general/urls.html

So I am trying to remove index.php from address using this manual: dev.lohv.eu/1/user_guide/general/urls.html

ATM我有地址 dev.lohv.eu/1/index.php ,但我想用它在未来没有index.php文件,就像这样: HTTP://dev.lohv .EU / 1 /

我按照说明书创建.htaccess文件:

I created .htaccess file according to manual:

RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L]

但unfortunaly失败,我得到404错误。我想这个问题是,我想配置的.htaccess子域文件夹,这样它不会适合作为人工,需要一些额外的,但我不知道是什么群众演员需要。

But unfortunaly it fails, I get 404 error. I guess the problem is, I am trying to configure .htaccess in subdomain folder so it wont fit as in manual and needs some extra, but I don't know what extras it needs.

推荐答案

我觉得你错过了一个?。 重写规则^(。*)$ /index.php?/$1 [L]

I think you're missing a '?'. RewriteRule ^(.*)$ /index.php?/$1 [L]

这是CI推荐的.htaccess模板(或者至少是一年前),而?两者之间的主要区别。

This is CI's recommended .htaccess template (or at least it was a year ago), and that ? is the major difference between the two.

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #Removes access to the system folder by users. #Additionally this will allow you to create a System.php controller, #previously this would not have been possible. #'system' can be replaced if you have renamed your system folder. RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule>

更多推荐

codeIgniter子域文件夹,删除从地址的index.php

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

发布评论

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

>www.elefans.com

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