国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 遂川县| 屏南县| 宁安市| 招远市| 旺苍县| 漳州市| 平邑县| 翁牛特旗| 边坝县| 罗山县| 大关县| 镇宁| 营山县| 云南省| 通道| 临高县| 沙洋县| 淮安市| 平乡县| 三亚市| 方城县| 嘉定区| 冕宁县| 焉耆| 海淀区| 阿合奇县| 开江县| 社旗县| 德兴市| 诏安县| 阿拉善左旗| 玉树县| 林芝县| 临沧市| 长汀县| 孝昌县| 横峰县| 龙海市| 台安县| 深泽县| 石屏县|