目前,我的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