国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開(kāi)發(fā) > PHP > 正文

apache+codeigniter 通過(guò).htcaccess做動(dòng)態(tài)二級(jí)域名解析

2024-05-04 23:14:52
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

復(fù)制代碼 代碼如下:


AuthName "yousite Website Coming Soon..." //如果你想給你的網(wǎng)站加個(gè)權(quán)限訪問(wèn)
AuthType Basic
AuthUserFile D:/xxx/.htpasswd #如果你想設(shè)置密碼訪問(wèn) 如何生成.htpasswd可以訪問(wèn)
#AuthGroupFile /dev/null
require valid-user

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

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


<IfModule mod_proxy.c>
# Redirect to boutique (with any trailing path)
RewriteCond %{HTTP_HOST} !^ [NC]
RewriteCond %{HTTP_HOST} ^([^.]+).yousite.com(.*)$ [NC]
RewriteRule ^(.*)$ $1$2 [P,L]
</IfModule>

<IfModule !mod_proxy.c>
# Redirect to boutique (with any trailing path)
RewriteCond %{HTTP_HOST} !^ [NC]
RewriteCond %{HTTP_HOST} ^([^.]+).yousite.com(.*)$ [NC]
RewriteRule ^(.*)$ %1/$1 [R=301,L]
</IfModule>

## Otherwise, force www;
RewriteCond %{HTTP_HOST} ^yousite.com$ [NC]
RewriteRule ^(.*)$ $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} !-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>


出處:cnblogs 微博:@草根小胡
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 南江县| 临漳县| 金山区| 丹东市| 买车| 苏尼特右旗| 平遥县| 平塘县| 临安市| 陆良县| 长治县| 虹口区| 朝阳区| 于田县| 乐都县| 洛扎县| 孝感市| 犍为县| 柳州市| 襄垣县| 黎城县| 东方市| 黎川县| 玛沁县| 三原县| 睢宁县| 芦溪县| 那坡县| 保山市| 防城港市| 和政县| 道孚县| 五华县| 临西县| 古丈县| 石景山区| 凌海市| 石景山区| 出国| 兰西县| 龙口市|