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

Codeigniter htaccess 刪除 index.php 和 www

Codeigniter htaccess to remove index.php and www(Codeigniter htaccess 刪除 index.php 和 www)
本文介紹了Codeigniter htaccess 刪除 index.php 和 www的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我試圖讓我的 htaccess 重寫規(guī)則從 url 中刪除 index.php 并且還將 www. 請求重定向到非 www 版本.

I'm trying to get my htaccess rewrite rules to remove the index.php from the url AND also redirect the www. requests to the non-www version.

這是我的 htaccess,它可以很好地刪除 index.php:

This is my htaccess which works fine with removing the index.php:

RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

我遇到了另一個關(guān)于如何刪除 www 部分的問題:

And I came across another question on how to remove the www part:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

但我似乎無法讓他們一起玩得很好!任何意見/建議最感謝!

But I just cant seem to get them to play nicely together! Any advice/suggestions most appreciated!

推薦答案

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

RewriteEngine On開始"重寫.RewriteCondRewriteRule 成對工作.在這里,我們首先將用戶發(fā)送到非 www 版本,并清理 URL.

RewriteEngine On "starts" rewriting. RewriteCond and RewriteRule work as pairs. Here, we send user to non-www version first, and cleans URLs.

這篇關(guān)于Codeigniter htaccess 刪除 index.php 和 www的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

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 中的部分(視圖),以便我的應(yīng)用程序中的所有視圖都可以訪問?) - IT屋-程序員軟件開發(fā)技術(shù)
Having a single entry point to a website. Bad? Good? Non-issue?(有一個網(wǎng)站的單一入口點.壞的?好的?沒問題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務(wù)層在 Zend 或 PHP 中常見嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
主站蜘蛛池模板: 性高湖久久久久久久久 | 激情五月婷婷在线 | 国产精品久久久久久婷婷天堂 | 亚洲免费三区 | 成人在线视频看看 | 四虎影院在线观看免费视频 | 欧美一级片免费看 | www.激情.com | 日韩超碰| 欧美9999 | 伊人精品在线视频 | 91精品一区二区三区久久久久久 | 一区二区三区四区免费在线观看 | 在线中文字幕视频 | 日韩精品在线一区 | 日韩欧美在线免费 | 亚洲精品一区二区在线观看 | 四虎影院免费在线播放 | 在线观看 亚洲 | 人人干在线视频 | 中文字幕1区2区3区 日韩在线视频免费观看 | 欧美亚洲国语精品一区二区 | 午夜视频在线免费观看 | 久久99这里只有精品 | 四虎在线观看 | 国产一区 | www.887色视频免费 | 久久一二 | 国产成人久久精品 | 免费在线性爱视频 | 国产不卡一 | 特级黄一级播放 | 精品久久亚洲 | 国产中文字幕在线 | 福利一区在线观看 | 久久久久久免费毛片精品 | 久久久久久天堂 | 美日韩视频 | 日韩精品中文字幕在线 | 国产欧美一区二区三区在线看 | 日韩中文电影 |