久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

CodeIgniter mod_rewrite 給出 404 錯誤

CodeIgniter mod_rewrite gives 404 error(CodeIgniter mod_rewrite 給出 404 錯誤)
本文介紹了CodeIgniter mod_rewrite 給出 404 錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我編寫了一個 CodeIgniter 應用程序,我想使用 mod_rewrite 來清理我的 URL.我已經在 htdocs/ci-intro/

I have written a CodeIgniter application and I want to use mod_rewrite to clean up my URL's. I have installed the CodeIgniter application in htdocs/ci-intro/

這是我的 .htaccess 文件:

Here is my .htaccess file:

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

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

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
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>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule> 

我將 CodeIgniter 中的 config.php 更改為以下內容:

I altered the config.php in CodeIgniter to the following:

$config['base_url'] = '';
$config['index_page'] = '';

每當我使用我的鏈接轉到關于頁面時,我都會收到來自 CodeIgniter 的 404 消息.我的瀏覽器中的 URL 似乎已被清理"(index.php 已刪除).這是網址:

Whenever I use my links to go to the about page I get a 404 message from CodeIgniter. The URL in my browser seems to be 'cleaned up' though (index.php is removed). This is the URL:

'http://localhost:8888/ci_intro/about'

'http://localhost:8888/ci_intro/about'

有人能幫我擺脫 404 錯誤并實際將使用定向到關于頁面嗎?

Can anybody help me getting rid of the 404 error and actually directing the use to the about page?

操作系統:MAC OS X 10.8.2(最新)
服務器軟件:MAMP
PHP:5.2.17
瀏覽器:Chrome &Safari(兩個瀏覽器都會出現這個問題)

OS: MAC OS X 10.8.2 (latest)
SERVER SOFTWARE: MAMP
PHP: 5.2.17
BROWSERS: Chrome & Safari (In both browsers this problem occurs)

推薦答案

試試這個...

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

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

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

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

這篇關于CodeIgniter mod_rewrite 給出 404 錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Action View Helper in Zend - Work around?(Zend 中的動作視圖助手 - 解決方法?)
Is this a good way to match URI to class/method in PHP for MVC(這是將 URI 與 PHP 中用于 MVC 的類/方法匹配的好方法嗎)
Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(視圖),以便我的應用程序中的所有視圖都可以訪問?) - IT屋-程序員軟件開發技術
Having a single entry point to a website. Bad? Good? Non-issue?(有一個網站的單一入口點.壞的?好的?沒問題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務層在 Zend 或 PHP 中常見嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
主站蜘蛛池模板: 国产不卡一区 | 久久国产精品视频 | 日韩综合 | 婷婷久久综合 | 精品日韩一区二区 | 99精品久久久国产一区二区三 | 国产99久久久久 | 黑人中文字幕一区二区三区 | 欧美激情综合 | 日韩欧美国产一区二区三区 | 国产精品久久久久久久久久久久午夜片 | 亚洲高清在线 | 精品国产区 | 亚洲天堂男人的天堂 | 国产精品99久久久久久大便 | 午夜国产 | 91精品国产乱码久久久久久久久 | 欧美福利 | 成人精品在线视频 | 成年人精品视频在线观看 | 久久69精品久久久久久久电影好 | 污污免费网站 | 中文字幕一区二区三区不卡 | 日韩www| 久草视频观看 | 国产免费一区二区三区网站免费 | 亚洲免费久久久 | 91高清在线观看 | 在线一区视频 | 青青久久 | 日韩中文一区 | 欧美精品欧美精品系列 | 亚洲综合久久网 | 热99视频| 日韩av在线中文字幕 | 日本黄色影片在线观看 | 成人福利在线 | 一区二区三区四区电影 | 成人在线一级片 | 亚洲精品电影在线观看 | 亚洲国产成人精品女人久久久 |