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

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Rewrite to keep original URL works for http, not https, why?

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
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: 6604
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


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1