Monday, December 5, 2011

Set Authorization header in Apache 2.2

RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{QUERY_STRING} ^tocwidget=true&service=CSW&version=2.0.2&elementSetName=full&outputSchema=EBRIM&request=GetRecordById&id=(.*)$

RequestHeader set Authorization "Basic xxxxxxxxxxx"
RewriteRule ^/erdas-apollo/catalog/csw(.*)$ /erdas-apollo/catalog/csw?%{QUERY_STRING} [R,L]


To use environment variable:

RewriteCond %{REQUEST_METHOD} POST

RewriteCond %{QUERY_STRING} ^tocwidget=true&service=CSW&version=2.0.2&elementSetName=full&outputSchema=EBRIM&request=GetRecordById&id=(.*)$

SetEnvIfNoCase Request_URI "/erdas-apollo/catalog/csw" havedon

RequestHeader set Authorization "Basic xxxxxxxx" env=havedon

RewriteRule ^/erdas-apollo/catalog/csw(.*)$ /erdas-apollo/catalog/csw?%{QUERY_STRING} [R,L]

No comments:

Post a Comment