Apache 2.0.50 および PHP 5.2.11 で WAMP 2.2 を実行しています。phpinfo を調べたSCRIPT_URI or SCRIPT_URL
ところ、このスクリプトを apache の httpd.conf ファイルに追加しようとしてもうまくいきませんでした。誰かがSCRIPT_URI or SCRIPT_URL
私のphpinfoにアイデアを持っていますか? ローカル マシンで実行しているサイトに必要です。
<IfModule rewrite_module>
<IfModule headers_module>
####### INITIAL SETUP #########################
RewriteEngine on
####### SET HEADERS #########################
#get and set the host name
RewriteRule .* - [E=INFO_HTTP_HOST:%{HTTP_HOST},NE]
RequestHeader set x-orig-host "%{INFO_HTTP_HOST}e"
#get and set the host port
RewriteRule .* - [E=INFO_SERVER_PORT:%{SERVER_PORT},NE]
RequestHeader set x-orig-port "%{INFO_SERVER_PORT}e"
#If the uri starts with a slash and some alphanumerics, then make a
#group of that until the first non-alpha (ie. the next slash)
RewriteCond %{REQUEST_URI} ^(/[\w-]+)
#Save the content of the regex match group ( %1 ) in an environment variable
RewriteRule .* - [E=INFO_REQUEST_CONTEXT:%1,NE]
#Set a header with the content of the environment variable
RequestHeader set x-orig-context "%{INFO_REQUEST_CONTEXT}e"
#If the accept-header contains a number after ;version= then make a regex group of that number
RewriteCond %{HTTP_ACCEPT} \+json;version=(\d+)$
#Save the content of the regex match group ( %1 ) in an environment variable
RewriteRule .* - [E=INFO_ACCEPT_VERSION:%1,NE]
#Set a header with the content of the environment variable
RequestHeader set x-orig-accept-version "%{INFO_ACCEPT_VERSION}e"
#If the accept-header contains kasia2. followed by some letters,
#then make a regex group of those letters
RewriteCond %{HTTP_ACCEPT} kasia2.(\w+).*
#Save the content of the regex match group ( %1 ) in an environment variable
RewriteRule .* - [E=INFO_ACCEPT_NAME:%1,NE]
#Set a header with the content of the environment variable
RequestHeader set x-orig-accept-name "%{INFO_ACCEPT_NAME}e"
#If https is on ...
RewriteCond %{HTTPS} on
#...then set the protocol environment variable to "https"
RewriteRule .* - [E=INFO_PROTOCOL:https,NE]
#If https is off ...
RewriteCond %{HTTPS} off
#...then we assume it must be "http"
RewriteRule .* - [E=INFO_PROTOCOL:http,NE]
#Finally, set the protocol header
RequestHeader set x-orig-protocol "%{INFO_PROTOCOL}e"
#Get the request uri and set an environment variable
RewriteRule .* - [E=INFO_REQUEST_URI:%{REQUEST_URI},NE]
#Build the whole original url out of the available parts. SCRIPT_URI is always null, otherwise we could have used that.
RequestHeader set x-orig-url "%{INFO_PROTOCOL}e://%{INFO_HTTP_HOST}e%{INFO_REQUEST_URI}e"
#In addition make an url with only the host and context, for convenience
RequestHeader set x-orig-url-base "%{INFO_PROTOCOL}e://%{INFO_HTTP_HOST}e%{INFO_REQUEST_CONTEXT}e"
</IfModule>
</IfModule>
これを機能させるためにphp.iniファイルで何かしなければならないことはありますか?