开发者

Apache ReWrite Rules with header info

开发者 https://www.devze.com 2023-02-12 16:41 出处:网络
APACHE 2.2 Ive been trying to redirect a user from a http: page to a https: page. I have been successful except for when I need to pass along header information in the request.

APACHE 2.2

Ive been trying to redirect a user from a http: page to a https: page.

I have been successful except for when I need to pass along header information in the request.

For example here is a copy of my working rewriteRule that does NOT pass header info

RewriteRule ^(.+)loginpage\.action$  https://%{HTTP_HOST}/webstore/loginpage.action [R=301,NC,L]

What I want to be able to do is to get the two to work together. Have a rewriteRule that not only moves to https but also passes along the header.

My current attempts seem to break the rule all together.

ex:

RewriteRule ^(.+)wishList\.action(开发者_运维问答.*)$  https://%{HTTP_HOST}/webstore/wishList.action$2? [R=301,NC,L]

Any help would be grateful. Thanks!


So i figured out my own issue. For some reason the NC which to my knowledge just made the redirect non case sensitive, was what was causing the issue.

New rewriteRule:

RewriteRule ^(.+)wishList\.action$  https://%{HTTP_HOST}/webstore/wishList.action [R=301,L]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号