logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.



Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Rewrite to keep original URL works for http, not https, why?
Author
rickx20000



Joined: 31 May 2019
Posts: 2
Location: Ottawa

PostPosted: Fri 31 May '19 17:46    Post subject: Rewrite to keep original URL works for http, not https, why? Reply with quote

Hello,

My TEST web server supports https website, the DEV server is configured for http.

I am having rewrite issue on TEST, but not on DEV. The details are following:

DEV:
I configure http://www-dev.royalcollege.ca/frm/index.html to rewrite to http://www-dev.royalcollege.ca/mssites/cbdpd/en/content/index.html, but keep the original url in user browser.

The rewrite works fine. On the browser, when I type http://www-dev.royalcollege.ca/frm/index.html, page content of http://www-dev.royalcollege.ca/mssites/cbdpd/en/content/index.html is displayed, and the short original path http://www-dev.royalcollege.ca/frm/index.html is still displayed as the URL instead of the full http://www-dev.royalcollege.ca/mssites/cbdpd/en/content/index.html. This is what I expect.

TEST:
When I type in https://www-test.royalcollege.ca/frm/index.html, rewrite works, but the full URL https://www-test.royalcollege.ca/mssites/cbdpd/en/content/index.html is shown in browser instead of the short original URL https://www-test.royalcollege.ca/frm/index.html. We expect the short/original URL displayed in browser.

The only difference between the DEV and TEST is the http vs. https.

The Web server configure entry is similar:

DEV:
RewriteRule ^/frm/(.*)$ http://www-dev.royalcollege.ca/mssites/cbdpd/en/content/$1 [P,L]

TEST:
RewriteRule ^/frm/(.*)$ https://www-test.royalcollege.ca/mssites/cbdpd/en/content/$1 [P,L]

It appears that the [P] parameter in Apache RewriteRule doesn't work for https, but for http.

Appreciated if there any idea /help,

Rick
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6673
Location: Germany, Next to Hamburg

PostPosted: Mon 03 Jun '19 12:57    Post subject: Reply with quote

I wonder why you use the P(roxy) flag instead of just rewriting the path.
Back to top
rickx20000



Joined: 31 May 2019
Posts: 2
Location: Ottawa

PostPosted: Mon 03 Jun '19 14:50    Post subject: Reply with quote

Since we have requirement to keep the original URL, I have to use the [P] flag. However, this works for http but not for https.
Back to top


Reply to topic   Topic: Rewrite to keep original URL works for http, not https, why? View previous topic :: View next topic
Post new topic   Forum Index -> Apache