1
在相關的Apache虛擬主機配置我有以下幾點:如何理解這些mod_rewrite日誌文件條目?
<Directory "/var/www/html/path">
RewriteEngine on
RewriteBase/
RewriteRule ^go\.html$ /out/qs.html?name=value
</Directory>
這裏是qs.html文件的內容:
<html>
<head><title>Query String</title></head>
<body>
<h2>Query String</h2>
<script>
document.write("<p>Query String: " + window.location.search.substring(1) + "</p>");
</script>
</body>
</html>
當我發送一個HTTP請求到服務器的/ path/go.html(沒有任何附加的查詢字符串),返回文檔,但在qs.html文檔的呈現中沒有看到查詢字符串。我期望看到「name = value」查詢字符串。
這裏與絨毛去除和行號的日誌文件添加相關線路:
1. [perdir /var/www/html/path/] strip per-dir prefix: /var/www/html/path/go.html -> go.html
2. [perdir /var/www/html/path/] applying pattern '^go\\.html$' to uri 'go.html'
3. [perdir /var/www/html/path/] rewrite 'go.html' -> '/out/qs.html?name=value'
4. split uri=/out/qs.html?name=value -> uri=/out/qs.html, args=name=value
5. [perdir /var/www/html/path/] trying to replace prefix /var/www/html/path/ with/
6. [perdir /var/www/html/path/] internal redirect with /out/qs.html [INTERNAL REDIRECT]
其實線1通3是幾乎什麼我希望,如果它只是停在那裏,我認爲,我會理解的。我不明白的是爲什麼它從這一點繼續,剩下的三條線告訴我什麼。有人可以幫我理解這一點。我正在爲這件事撕碎我的頭髮。謝謝。
... doug
非常感謝!因此,基本上我認爲您所說的是,如果想要模糊特定URL已被重寫的事實,則需要服務器端支持。這是非常重要的一點。此外,它有很多意義。我想這是非常有道理的,每個人都只是假設用戶知道它。再次,非常感謝您的幫助。我很高興終於把這個問題拋在身後。 – user3311045