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