📄 rewriteguide.html.ko.euc-kr
字号:
炼扒阑 眠啊且 荐 乐瘤父, 歹 亮篮 规过捞 乐促:</p><div class="example"><pre>RewriteEngine onRewriteCond %{REQUEST_URI} <strong>!-U</strong>RewriteRule ^(.+) http://<strong>webserverB</strong>.dom/$1</pre></div> <p><code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>狼 URL 傈规曼炼(look-ahead)甫 荤侩茄促. 弊贰辑 葛电 URL俊 悼累窍绊 救傈窍促. 弊矾唱 葛电 夸没付促 郴何 窍困夸没阑 茄锅 歹 窍扁锭巩俊 昆辑滚 己瓷俊 厩康氢阑 霖促. 弊贰辑 碍仿茄 CPU俊辑 昆辑滚甫 角青茄促搁 荤侩窍扼. 哪腔磐啊 蠢府促搁 霉锅掳 规过捞唱 歹 唱篮 <code class="directive"><a href="../mod/core.html#errordocument">ErrorDocument</a></code> CGI 胶农赋飘甫 荤侩窍扼.</p> </dd> </dl> <h3>犬厘 府促捞泛记</h3> <dl> <dt>惑炔汲疙:</dt> <dd> <p>啊阐 府促捞泛记窍绰 URL阑 歹 炼例且 鞘夸啊 乐促. 酒颇摹 郴何 URL escape 窃荐绰 "<code>url#anchor</code>" 鞍篮 URL狼 anchor档 escape茄促. 酒颇摹狼 <code>uri_escape()</code> 窃荐绰 快拱沥磊(#)档 鞍捞 escape窍骨肺 荤侩且 荐 绝促. 弊矾搁 绢痘霸 捞繁 URL肺 府促捞泛记且 荐 乐唱?</p> </dd> <dt>秦搬氓:</dt> <dd> <p>流立 府促捞泛记窍绰 NPH-CGI 胶农赋飘甫 荤侩茄 秦搬氓捞 鞘夸窍促. escape甫 窍瘤 臼扁锭巩捞促 (NPH=non-parseable headers). 刚历 促澜 辑滚汲沥阑 窍咯 (犁累己 痹蘑狼 场何盒俊 荤侩秦具 茄促) 货肺款 URL scheme <code>xredirect:</code>甫 档涝茄促:</p><div class="example"><pre>RewriteRule ^xredirect:(.+) /path/to/nph-xredirect.cgi/$1 \ [T=application/x-httpd-cgi,L]</pre></div> <p>弊矾搁 <code>xredirect:</code>肺 矫累窍绰 葛电 URL篮 <code>nph-xredirect.cgi</code> 橇肺弊伐阑 烹窍霸 等促. 橇肺弊伐篮 促澜苞 鞍促:</p><div class="example"><pre>#!/path/to/perl#### nph-xredirect.cgi -- NPH/CGI script for extended redirects## Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved.##$| = 1;$url = $ENV{'PATH_INFO'};print "HTTP/1.0 302 Moved Temporarily\n";print "Server: $ENV{'SERVER_SOFTWARE'}\n";print "Location: $url\n";print "Content-type: text/html\n";print "\n";print "<html>\n";print "<head>\n";print "<title>302 Moved Temporarily (EXTENDED)</title>\n";print "</head>\n";print "<body>\n";print "<h1>Moved Temporarily (EXTENDED)</h1>\n";print "The document has moved <a HREF=\"$url\">here</a>.<p>\n";print "</body>\n";print "</html>\n";##EOF##</pre></div> <p>弊矾搁 <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>啊 流立 罐瘤给窍绰 葛电 URL scheme栏肺 府促捞泛记且 荐 乐促. 抗甫 甸绢, 促澜苞 鞍捞 <code>news:newsgroup</code>栏肺 府促捞泛记且 荐 乐促</p><div class="example"><pre>RewriteRule ^anyurl xredirect:news:newsgroup</pre></div> <div class="note">林狼: 困狼 漂喊茄 "烹苞" 痹蘑阑 荤侩窍咯 <code>xredirect:</code>甫 付瘤阜俊 犬厘秦具 窍扁锭巩俊 痹蘑俊 <code>[R]</code>捞唱 <code>[R,L]</code>阑 荤侩窍搁 救等促.</div> </dd> </dl> <h3>历厘家 立辟 吝拌(multiplexer)</h3> <dl> <dt>惑炔汲疙:</dt> <dd> <p><a href="http://www.perl.com/CPAN">http://www.perl.com/CPAN</a>俊 乐绰 措窜茄 CPAN (Comprehensive Perl Archive Network)阑 酒绰啊? 捞 林家绰 技拌俊 瑞绢柳 咯矾 CPAN 固矾 FTP 辑滚吝 努扼捞攫飘俊 啊鳖捞 乐绰 辑滚肺 府促捞泛记茄促. 捞甫 FTP 立辟 吝拌 辑厚胶扼绊 茄促. CPAN篮 CGI 胶农赋飘甫 荤侩窍瘤父, <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>甫 荤侩窍咯 厚搅窍霸 父甸 荐 乐阑鳖?</p> </dd> <dt>秦搬氓:</dt> <dd> <p>刚历 <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> 3.0.0 滚傈何磐 府促捞泛记俊 "<code>ftp:</code>" scheme阑 荤侩且 荐 乐促. 促澜栏肺 努扼捞攫飘狼 弥惑困 档皋牢阑 <code class="directive"><a href="../mod/mod_rewrite.html#rewritemap">RewriteMap</a></code>苞 鞍捞 荤侩窍咯 困摹甫 眠沥且 荐 乐促. 汗棱洒 揩牢 痹蘑俊辑 弥惑困 档皋牢阑 吝拌甘狼 虐肺 荤侩茄促.</p><div class="example"><pre>RewriteEngine onRewriteMap multiplex txt:/path/to/map.cxanRewriteRule ^/CxAN/(.*) %{REMOTE_HOST}::$1 [C]RewriteRule ^.+\.<strong>([a-zA-Z]+)</strong>::(.*)$ ${multiplex:<strong>$1</strong>|ftp.default.dom}$2 [R,L]</pre></div><div class="example"><pre>#### map.cxan -- Multiplexing Map for CxAN##de ftp://ftp.cxan.de/CxAN/uk ftp://ftp.cxan.uk/CxAN/com ftp://ftp.cxan.com/CxAN/ :##EOF##</pre></div> </dd> </dl> <h3>矫埃俊 蝶弗 犁累己</h3> <dl> <dt>惑炔汲疙:</dt> <dd> <p>矫埃俊 蝶扼 促弗 郴侩阑 辑厚胶窍绰 版快 腹篮 昆包府磊绰 泪矫 漂喊茄 其捞瘤肺 府促捞泛记窍扁困秦 CGI 胶农赋飘甫 荤侩茄促. <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>肺绰 绢痘霸 且 荐 乐绰啊?</p> </dd> <dt>秦搬氓:</dt> <dd> <p>犁累己 炼扒俊辑 荤侩且 荐 乐绰 咯矾 <code>TIME_xxx</code> 函荐啊 乐促. 函荐客 漂喊茄 荤傈鉴辑 厚背 <code><STRING</code>, <code>>STRING</code>, <code>=STRING</code>阑 荤侩窍咯 矫埃俊 蝶扼 府促捞泛记且 荐 乐促:</p><div class="example"><pre>RewriteEngine onRewriteCond %{TIME_HOUR}%{TIME_MIN} >0700RewriteCond %{TIME_HOUR}%{TIME_MIN} <1900RewriteRule ^foo\.html$ foo.day.htmlRewriteRule ^foo\.html$ foo.night.html</pre></div> <p>URL <code>foo.html</code>阑 夸没窍搁 <code>07:00-19:00</code> 悼救 <code>foo.day.html</code> 郴侩阑 辑厚胶窍绊, 唱赣瘤 矫埃 悼救 <code>foo.night.html</code> 郴侩阑 辑厚胶茄促. 权其捞瘤俊辑 荤侩窍扁 亮篮 扁瓷捞促...</p> </dd> </dl> <h3>YYYY甫 XXXX肺 捞傈茄 版快 开龋券</h3> <dl> <dt>惑炔汲疙:</dt> <dd> <p>咯矾 <code>.html</code> 颇老阑 <code>.phtml</code>肺 函券窍绰 殿 <code>document.YYYY</code>甫 <code>document.XXXX</code>肺 捞傈茄饶 开龋券(backward compatibility) URL阑 (啊惑利栏肺 粮犁窍霸) 父甸 荐 乐唱?</p> </dd> <dt>秦搬氓:</dt> <dd> <p>捞抚阑 扁夯捞抚栏肺 犁累己茄饶 货肺款 犬厘磊甫 啊柳 颇老捞 乐绰瘤 八荤茄促. 乐促搁 弊 颇老疙阑 荤侩窍绊, 绝栏搁 URL阑 盔贰 惑怕肺 犁累己茄促.</p><div class="example"><pre># 巩辑.html 捞 绝绊# 巩辑.phtml 父 乐绰 版快# 巩辑.html 阑 巩辑.phtml 肺# 犁累己窍绰 开龋券 痹蘑RewriteEngine onRewriteBase /~quux/# 扁夯捞抚阑 茫绊, 茫疽促绰 荤角阑 扁撅茄促RewriteRule ^(.*)\.html$ $1 [C,E=WasHTML:yes]# 颇老捞 乐促搁 巩辑.phtml 肺 犁累己茄促RewriteCond %{REQUEST_FILENAME}.phtml -fRewriteRule ^(.*)$ $1.phtml [S=1]# 酒聪搁 菊俊辑 茫篮 扁夯捞抚阑 登倒赴促RewriteCond %{ENV:WasHTML} ^yes$RewriteRule ^(.*)$ $1.html</pre></div> </dd> </dl> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="content" id="content">牧刨明 促风扁</a></h2> <h3>货肺 捞傈 (皑眠扁)</h3> <dl> <dt>惑炔汲疙:</dt> <dd> <p>弥辟 <code>foo.html</code>阑 <code>bar.html</code>肺 函版窍绊 开龋券己阑 困秦 捞傈 URL阑 拌加 力傍窍绊 酵促绊 啊沥窍磊. 荤侩磊绰 捞傈 URL捞 函版登菌促绰 荤角阑 传摹盲瘤 给茄促.</p> </dd> <dt>秦搬氓:</dt> <dd> <p>促澜 痹蘑栏肺 捞傈 URL阑 郴何利栏肺 货肺款 URL肺 犁累己茄促:</p><div class="example"><pre>RewriteEngine onRewriteBase /~quux/RewriteRule ^<strong>foo</strong>\.html$ <strong>bar</strong>.html</pre></div> </dd> </dl> <h3>货肺 捞傈 (舅府扁)</h3> <dl> <dt>惑炔汲疙:</dt> <dd> <p>促矫 <code>foo.html</code>阑 <code>bar.html</code>肺 函版窍绊 开龋券己阑 困秦 捞傈 URL阑 拌加 力傍窍绊 酵促绊 啊沥窍磊. 弊矾唱 捞力绰 捞傈 URL阑 荤侩窍搁 荤侩磊俊霸 货肺款 URL阑 腮飘肺 舅妨霖促. 溜, 宏扼快历 林家芒捞 函茄促.</p> </dd> <dt>秦搬氓:</dt> <dd> <p>货肺款 URL肺 HTTP 府促捞泛记窍促. 弊矾搁 宏扼快历啊 货肺款 URL甫 焊捞绊 函版荤角阑 荤侩磊啊 舅霸等促:</p><div class="example"><pre>RewriteEngine onRewriteBase /~quux/RewriteRule ^<strong>foo</strong>\.html$ <strong>bar</strong>.html [<strong>R</strong>]</pre></div> </dd> </dl> <h3>宏扼快历俊 蝶弗 郴侩</h3> <dl> <dt>惑炔汲疙:</dt> <dd> <p>弥家茄 吝夸茄 弥惑困 其捞瘤绰 宏扼快历俊 弥利拳等 郴侩栏肺 辑厚胶秦具且 版快啊 乐促. 溜, 弥脚 Netscape 宏扼快历俊霸绰 弥惑狼 滚傈阑, Lynx 宏扼快历俊霸绰 弥历 滚傈阑, 唱赣瘤 宏扼快历俊绰 乞闭利牢 滚傈阑 力傍茄促.</p> </dd> <dt>秦搬氓:</dt> <dd> <p>宏扼快历啊 郴侩蛆惑阑 困秦 磊脚狼 辆幅俊 措茄 沥焊甫 力傍窍瘤 臼扁锭巩俊 郴侩蛆惑阑 荤侩且 荐 绝促. 措脚 HTTP "User-Agent" 庆歹甫 荤侩茄促. 促澜 痹蘑篮 HTTP "User-Agent" 庆歹啊 "Mozilla/3"栏肺 矫累窍搁 <code>foo.html</code> 其捞瘤甫 <code>foo.NS.html</code>肺 犁累己窍绊 犁累己阑 吝窜茄促. 宏扼快历啊 "Lynx"唱 "Mozilla" 滚傈 1 趣篮 2扼搁 URL篮 <code>foo.20.html</code>捞 等促. 唱赣瘤 宏扼快历绰 <code>foo.32.html</code> 其捞瘤甫 罐绰促. 酒贰 痹蘑捞 捞 累诀阑 茄促:</p><div class="example"><pre>RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/3</strong>.*RewriteRule ^foo\.html$ foo.<strong>NS</strong>.html [<strong>L</strong>]RewriteCond %{HTTP_USER_AGENT} ^<strong>Lynx/</strong>.* [OR]RewriteCond %{HTTP_USER_AGENT} ^<strong>Mozilla/[12]</strong>.*RewriteRule ^foo\.html$ foo.<strong>20</strong>.html [<strong>L</strong>]RewriteRule ^foo\.html$ foo.<strong>32</strong>.html [<strong>L</strong>]</pre></div> </dd> </dl> <h3>悼利 固矾</h3> <dl> <dt>惑炔汲疙:</dt> <dd> <p>寇何 龋胶飘俊 快府 荤捞飘肺 啊廉坷绊 酵篮 亮篮 昆其捞瘤啊 乐促绊 啊沥窍磊. FTP 辑滚狼 版快 流立 寇何 磊丰狼 弥脚汗荤夯阑 蜡瘤窍绰 <code>mirror</code> 橇肺弊伐阑 荤侩且 荐 乐绊, 昆辑滚扼搁 HTTP肺 厚搅茄 累诀阑 窍绰 <code>webcopy</code> 橇肺弊伐阑 荤侩且 荐 乐促. 弊矾唱 滴 规过 葛滴 窜痢捞 乐促: 汗荤夯篮 啊阐究 橇肺弊伐阑
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -