.htaccess文件是Apache服務器中的一個配置文件,它負責相關目錄下的網頁配置。php
httpd.ini文件是IIS的配置文件。html
web.config文件是一個XML文本文件,它用來儲存ASP.NETWeb 應用程序的配置信息。web
.httaccess 格式:服務器
<
IfModule
mod_rewrite.c>
app
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</
IfModule
>
[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteRule /(?!Public)(?!include)(?!Uploads)(.*) /index.php\//$1 [L]
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
configuration
>
<
system.webServer
>
<
rewrite
>
<
rules
>
<
rule
name
=
"已導入的規則 1"
stopProcessing
=
"true"
>
<
match
url
=
"^(.*)$"
ignoreCase
=
"false"
/>
<
conditions
logicalGrouping
=
"MatchAll"
>
<
add
input
=
"{REQUEST_FILENAME}"
matchType
=
"IsDirectory"
ignoreCase
=
"false"
negate
=
"true"
/>
<
add
input
=
"{REQUEST_FILENAME}"
matchType
=
"IsFile"
ignoreCase
=
"false"
negate
=
"true"
/>
</
conditions
>
<
action
type
=
"Rewrite"
url
=
"index.php/{R:1}"
appendQueryString
=
"true"
/>
</
rule
>
<
rule
name
=
"已導入的規則 2"
stopProcessing
=
"true"
>
<
match
url
=
"^korean/(.*)$"
ignoreCase
=
"false"
/>
<
conditions
logicalGrouping
=
"MatchAll"
>
<
add
input
=
"{REQUEST_FILENAME}"
matchType
=
"IsDirectory"
ignoreCase
=
"false"
negate
=
"true"
/>
<
add
input
=
"{REQUEST_FILENAME}"
matchType
=
"IsFile"
ignoreCase
=
"false"
negate
=
"true"
/>
</
conditions
>
<
action
type
=
"Rewrite"
url
=
"korean/index.php/{R:1}"
appendQueryString
=
"true"
/>
</
rule
>
</
rules
>
</
rewrite
>
</
system.webServer
>
</
configuration
>