目前,我的Apache RewriteRule
僅將原始URL的路徑作爲查詢參數傳遞到重寫的URL。Apache RewriteRule將整個URL作爲參數傳遞
如何將整個URL(包括方案和權限等)作爲參數發送到重寫的URL?
我知道%{REQUEST_URI}
只通過路徑,我看不到任何可以傳遞整個URL的Apache環境變量。
我是一個初學者的Apache配置的東西,所以請原諒我的一部分的任何無知,
的感謝!
這裏是我當前的配置:
#
# Enable Rewrite
#
RewriteEngine On
#
# Condition for rewriting the URL. Check the URL's path is a valid REST URI path
#
RewriteCond %{REQUEST_URI} ^(?:[^?#]*)(?:/v[0-9]+(?:\.[0-9]+)*)(?:/[a-z]+)(?:/[a-z]+)(?:/?[^/?#]*)(?:[^?#]*)$
#
# Rewrite the URL, sending the REST path as a parameter to the specified version.
#
RewriteRule ^(?:[^?#]*)(?:/(v[0-9]+(?:\.[0-9]+)*))((?:/[a-z]+)(?:/[a-z]+)(?:/?[^/?#]*)(?:[^?#]*))$ https://localhost/rest/$1/index.php?request_uri_path=https://localhost/rest/$1/$2 [QSA,NC,L,R=307]
目前,我已經硬編碼的網址查詢參數,以便網址
https://localhost/rest/v1/users/show/12345
變爲:
https://localhost/rest/v1/index.php?request_uri_path=https://localhost/rest/v1/users/show/12345
哪個版本的Apache的是什麼呢? – hjpotter92