??? /server/?Server=ServerName
重寫為 /server/ServerName
,以便 ServerName
????? URL? PHP? ????? ???.
?? ? .htaccess
??? ??? ????:
??? /server/ServerName
或 /server/?Server=ServerName
??? ? ? 404 ??? ??????.
??? ? ??? ?????:
????? ????? ???? ??? ?? ?? ? ??? ??? ??? ?????.
??? ?????:
?? ??? ??? ?????? ???? ?? ??? ????? ??? ??? ????.
?? ??? ???? ????? ????? ???? /test2/
重寫為 /server/?Server=ServerName
???? ? ??????? ??? ????? ?? ??? ? ? ????.
? ??? ????? ???? ?????. URL? ?? ???? ??? ???? ?????. Apache 2.4 .htaccess ???? URL ???
RewriteEngine on RewriteBase / RewriteCond %{QUERY_STRING} Server=([^&]+) RewriteRule "^server/$" "/server/%1/?"
??? ???? ?? ?? ? ????. ???? ?? HTML ??? /server/ServerName
,因此在內(nèi)部將請求從 /server/ServerName
重寫為 /em> /server/index.php?Server=ServerName
(請注意添加 index.php
,如注釋中所述)。 /server/index.php?Server=ServerName
? ??? ??? ???? ??(???) ?? ?????.
??? ???? ???? ? ???...
URL? ?? ???? ???. ??? ??? ???? ???? ????. "?? ??"? ??? ????? ?? ??? ??? ?? ? ????. URL? ???? ????. URL? .htaccess
?? ?? ?? ? ???? ???. HTML ???? ????? URL? ???? ???? ???.
??? ?? ??? ?? "????"? (?????) ??? ? ????. ??? ?? URL? ?????. ??? ?? ?? ?? URL? ????? ??? ??? ? ?? ?? ?? ? ?3?? ?????? ??? ?????. ??? ?? SEO? ?? ??? ?? "??"??? ?? ?? ????.
???? ?? ??? ???.
/server/ServerName
??? URL? ?????. /server/?Server=ServerName
(?? /server/index.php?Server= ServerName
)?? ???????. >)? /server/?Server=ServerName
(或 /server/index.php?Server=ServerName) 到 /server/ServerName
(?? URL)? ?????.
/server/ServerName
(規(guī)范 URL/您要鏈接到的 URL)重寫為 /server/index.php?Server=ServerName
(?? URL/????? URL)? ??? /server/index.php?Server=ServerName
(??? ???? ?? ??)? ????? ?? ?????. ?? .htaccess
????:
?? ??? ???? END
???? ??? ? ??? Apache 2.4? ????? ?????. ??? ?? "?? ???" ?? ?? ?? ??? ???? ? ?? ??? ?? condition? ???? ????(???? ?? ??).
? ?? ??("????")?? index.php
??? ?? ?????. %1
????? ?? index.php
部分是可選的。 %1
反向引用包含在前面的條件中捕獲的Server
URL 參數(shù)的值。 Server
condition
Server
URL ????? ?? ???? ????. ??
URL ????? ?? ?? ??? ?? (?? ???? ??? ?? ???? ??) ??? ???? ??? ? ????. ??? ??? ??????? ?? ???? ????. ??? ?? ???? ??? ??? ???? ?????? ???? ????. ????? ?? ???? ??? URL ? ?? ???(?: /server/ServerName//server/ServerName
)? ??? ???? ?????. /code >), ??? RewriteRule
/server/ServerName
而不是 /server/ServerName/),因此我刪除了 RewriteRule
pattern 末尾的可選 /?
pattern
/?
??? ??? ??????. ??? ?? ?? ??? ??? ?? ??? ????? ?? ??? ? ??? ??? URL? ???? ?? ?? ?? ???(???)? ????? "?? ??"? ??? ??? URL? ????? ?? ??? "????"?? ???? ???. ???? ?? URL? ?? URL???.)
Server
URL 參數(shù)值中期望的值,NE
(noescape
) 標(biāo)志可能是也可能不是必需的。 QUERY_STRING
?? ??? ???? ???? URL???.
.htaccess
中使用 PT
(passthrough
) 標(biāo)志,因為這是此上下文中的默認行為。 (PT
server ?? vhost ?????? mod_rewrite? ??? ?? ??? ???? ??? ??? ????. )