首頁 後端開發 php教程 apache+codeigniter 透過.htcaccess做動態二級域名解析

apache+codeigniter 透過.htcaccess做動態二級域名解析

Dec 17, 2016 am 09:30 AM

. 程式碼如下:


AuthName "yousite Website Coming Soon..." //如果你想為你的網站加個權限訪問 
AuthType Basic 
AuthUserFile D:/xxx/.htpasswd #如果你想設定密碼存取如何產生.htpasswd可以存取http://www.htaccesstools.com/htpasswd-generator/ 
#AuthGroupFile /dev/null 
require valid-user 

#Additionally this will allow you to create a System.php controller, 
#previously this would not have been possible. 
#'system' canly this would not have been possible. 
#'system' can be reaved if RewriteCond %{REQUEST_URI} ^system.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 

#When your application folder isn't in the system folder application folder 
#Submitted by: Fabdrol 
#Rename 'application' to your applications folder name. 
RewriteCond %{REQUEST_URI} ^application.* 
RewriteCond %{REQUEST_URI} ^application.* 
RewriteCond %{REQUEST_URI} ^application.* 

 
# Redirect to boutique (with any trailing path) 
RewriteCond %{HTTP_HOST} !^www. [NC] 
RewriteCond %{TP_HOST] .*)$ [NC] 
RewriteRule ^(.*)$ http://www.yousite.com/boutique/$1$2 [P,L] 
 

 

Redirect to boutique (with any trailing path) 
RewriteCond %{HTTP_HOST} !^www. [NC] 
RewriteCond %{HTTP_HOST} ^([^.]+).yousite.com(.*)$ [NC. ^(.*)$ http://www.yousite.com/boutique/%1/$1 [R=301,L] 
 

## Otherwise, force www; 
RewriteCond %{HTTP_HOST} ^RewriteCond %{HTTP_HOST} ^ yousite.com$ [NC] 
RewriteRule ^(.*)$ http://www.yousite.com/$1 [R=301,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} !-f 
RewriteCond %{REQUEST_FILENIL} !-f * ) $ as normal. 
# Submitted by: ElliotHaughin 

ErrorDocument 404 /index.php 
 

 以上就是apache+codeigniter 透過使用更多網域的動態內容,第二級動態文章解析出在中文上加分! (www.php.cn)! 

 




本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱門文章

倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章

倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章標籤

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

c++屬於前端還是後端 c++屬於前端還是後端 Apr 22, 2024 pm 05:33 PM

c++屬於前端還是後端

PHP 框架效能比較:速度與效率的終極對決 PHP 框架效能比較:速度與效率的終極對決 Apr 30, 2024 pm 12:27 PM

PHP 框架效能比較:速度與效率的終極對決

html檔案怎麼產生網址 html檔案怎麼產生網址 Apr 21, 2024 pm 12:57 PM

html檔案怎麼產生網址

evasive 模組保護您的網站免受應用程式層 DOS 攻擊 evasive 模組保護您的網站免受應用程式層 DOS 攻擊 Apr 30, 2024 pm 05:34 PM

evasive 模組保護您的網站免受應用程式層 DOS 攻擊

Java 並發程式設計如何進行並發測試與除錯? Java 並發程式設計如何進行並發測試與除錯? May 09, 2024 am 09:33 AM

Java 並發程式設計如何進行並發測試與除錯?

golang函數並發控制與第三方函式庫的整合與擴展 golang函數並發控制與第三方函式庫的整合與擴展 Apr 25, 2024 am 09:27 AM

golang函數並發控制與第三方函式庫的整合與擴展

eclipse如何新增伺服器 eclipse如何新增伺服器 May 05, 2024 pm 07:27 PM

eclipse如何新增伺服器

演算法在 58 畫像平台建置中的應用 演算法在 58 畫像平台建置中的應用 May 09, 2024 am 09:01 AM

演算法在 58 畫像平台建置中的應用

See all articles