Re: [WebDNA] Does [referrer] get lost when server switches from http

This WebDNA talk-list message is from

2020


It keeps the original formatting.
numero = 115062
interpreted = N
texte = 2691 You might be able to do this entirely in WebDNA with something like this = (untested):=20 [if ("[thisport]"=3D"443")|("[GetMIMEHeader = name=3DX-Forwarded-Proto]"=3D"https")] [then] [!] Do not redirect. The page is either served directly via = https or the proxy is secure [/!] [!] Capture standard referrer or let form variable overwrite it. = Caveat: value can be hacked. [/!] [text secure=3Df]this_referrer=3D[referrer][/text] [/then] [else] [!] Redirect to https. Include referrer in GET. [/!] [redirect https://[listmimeheaders = name=3Dhost&exact=3DF][value][/listmimeheaders][thisurlplusget][showif = [url][referrer][/url]!][if = "[url][thisurlplusget][/url]"^"?"][then]&[/then][else]?[/else][/if]this_re= ferrer=3D[referrer]][/showif] [/else] [/if] [this_referrer] Mike > On Mar 2, 2020, at 10:17 AM, talk@webdna.us wrote: >=20 > I think I will answer my own question here: >=20 > Yes, WebDNA's [referrer] value gets "lost" when Apache > rewrites the original "http" URL to "https" by using this > code in the main Apache config file: >=20 > # This first vhost block forces all http visits to https: > > ServerName domain.com > ServerAlias www.domain.com > RewriteEngine On > RewriteCond %{SERVER_PORT} 80 [OR] > RewriteCond %{HTTP_HOST} ^domain\.com > RewriteRule ^(.*)$ https://www.domain.com/$1 [R=3D301,L] > >=20 > I should probably try to append Apache's {HTTP_REFERER} value > to the last rewrite rule above. Then maybe WebDNA will be > able to interpret it on the next page. Not sure if this > RewriteRule will work but it may be worth a try: >=20 > RewriteRule ^(.*)$ > https://www.domain.com/$1&referrer=3D{HTTP_REFERER} [R=3D301,L] >=20 > Regards, > Kenneth Grome > WebDNA Solutions > http://www.webdnasolutions.com > Urgent/Emergency Phone: (228) 222-2917 > Website, Database, Network, and Communication Systems >=20 >=20 >=20 >=20 >=20 >=20 >=20 >> I haven't needed or used the [referrer] tag in ages, but >> now that I have a use for it I'm not getting the results I >> expect. Here's everything the docs say about it: >>=20 >>> Putting [referrer] in your template displays the URL of >>> the referring page that led to this one. This is a handy >>> way to give visitors a "back up" button. >>>=20 >>> Note: this will not work if the previous page was a FORM >>> METHOD=3D"POST" =20 >>=20 >> This "method=3Dpost" limitation is not the cause of my >> problem. In my situation "method=3Dget" is being used via >> simple links that look like this: >>=20 >> http://www.domain.com/thePage.dna?code=3D123&utm_campaign=3DsomeValue >>=20 >> Note that this link example is "http" not "https". >>=20 >> I have my server configured to serve everything via "https" >> which means it is force-switching all these "http" visits to >> "https", and this makes me wonder ... >>=20 >> Does this forced-switching to "https" cause WebDNA to lose >> its [referrer] value? >>=20 >> Regards, >> Kenneth Grome >> WebDNA Solutions >> http://www.webdnasolutions.com >> Urgent/Emergency Phone: (228) 222-2917 >> Website, Database, Network, and Communication Systems >>=20 >>=20 >>=20 >=20 >=20 >=20 >=20 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list talk@webdna.us > To unsubscribe, E-mail to: talk-leave@webdna.us > archives: http://www.webdna.us/page.dna?numero=3D55 > Bug Reporting: support@webdna.us --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Does [referrer] get lost when server switches from http (WebDNA Solutions - Kenneth Grome 2020)
  2. Re: [WebDNA] Does [referrer] get lost when server switches from http (Michael Davis 2020)
  3. Re: [WebDNA] Does [referrer] get lost when server switches from http (Stuart Tremain 2020)
  4. [WebDNA] Does [referrer] get lost when server switches from http to https? (WebDNA Solutions 2020)
2691 You might be able to do this entirely in WebDNA with something like this = (untested):=20 [if ("[thisport]"=3D"443")|("[GetMIMEHeader = name=3DX-Forwarded-Proto]"=3D"https")] [then] [!] Do not redirect. The page is either served directly via = https or the proxy is secure [/!] [!] Capture standard referrer or let form variable overwrite it. = Caveat: value can be hacked. [/!] [text secure=3Df]this_referrer=3D[referrer][/text] [/then] [else] [!] Redirect to https. Include referrer in GET. [/!] [redirect https://[listmimeheaders = name=3Dhost&exact=3DF][value][/listmimeheaders][thisurlplusget][showif = [url][referrer][/url]!][if = "[url][thisurlplusget][/url]"^"?"][then]&[/then][else]?[/else][/if]this_re= ferrer=3D[referrer]][/showif] [/else] [/if] [this_referrer] Mike > On Mar 2, 2020, at 10:17 AM, talk@webdna.us wrote: >=20 > I think I will answer my own question here: >=20 > Yes, WebDNA's [referrer] value gets "lost" when Apache > rewrites the original "http" URL to "https" by using this > code in the main Apache config file: >=20 > # This first vhost block forces all http visits to https: > > ServerName domain.com > ServerAlias www.domain.com > RewriteEngine On > RewriteCond %{SERVER_PORT} 80 [OR] > RewriteCond %{HTTP_HOST} ^domain\.com > RewriteRule ^(.*)$ https://www.domain.com/$1 [R=3D301,L] > >=20 > I should probably try to append Apache's {HTTP_REFERER} value > to the last rewrite rule above. Then maybe WebDNA will be > able to interpret it on the next page. Not sure if this > RewriteRule will work but it may be worth a try: >=20 > RewriteRule ^(.*)$ > https://www.domain.com/$1&referrer=3D{HTTP_REFERER} [R=3D301,L] >=20 > Regards, > Kenneth Grome > WebDNA Solutions > http://www.webdnasolutions.com > Urgent/Emergency Phone: (228) 222-2917 > Website, Database, Network, and Communication Systems >=20 >=20 >=20 >=20 >=20 >=20 >=20 >> I haven't needed or used the [referrer] tag in ages, but >> now that I have a use for it I'm not getting the results I >> expect. Here's everything the docs say about it: >>=20 >>> Putting [referrer] in your template displays the URL of >>> the referring page that led to this one. This is a handy >>> way to give visitors a "back up" button. >>>=20 >>> Note: this will not work if the previous page was a FORM >>> METHOD=3D"POST" =20 >>=20 >> This "method=3Dpost" limitation is not the cause of my >> problem. In my situation "method=3Dget" is being used via >> simple links that look like this: >>=20 >> http://www.domain.com/thePage.dna?code=3D123&utm_campaign=3DsomeValue >>=20 >> Note that this link example is "http" not "https". >>=20 >> I have my server configured to serve everything via "https" >> which means it is force-switching all these "http" visits to >> "https", and this makes me wonder ... >>=20 >> Does this forced-switching to "https" cause WebDNA to lose >> its [referrer] value? >>=20 >> Regards, >> Kenneth Grome >> WebDNA Solutions >> http://www.webdnasolutions.com >> Urgent/Emergency Phone: (228) 222-2917 >> Website, Database, Network, and Communication Systems >>=20 >>=20 >>=20 >=20 >=20 >=20 >=20 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list talk@webdna.us > To unsubscribe, E-mail to: talk-leave@webdna.us > archives: http://www.webdna.us/page.dna?numero=3D55 > Bug Reporting: support@webdna.us --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us . Michael Davis

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

# fields limited? (1997) Authorize.net? (2003) Contain in search (2005) Two options to consider (2008) X etc.... (1999) WebCat chatroom (1997) Help with Shipping Costs (1997) WebDNA 4.5.1 Now Available (2003) checking for [ and ] in form fields ... (1997) shownext (2001) Not really WebCat (1997) [OT] WebStar SSL (2004) Invisible file issue now a real 'bug' (1999) [WebDNA] Rewrite url (2013) [WebDNA] db admin tool (2008) Quit revisited (1997) I guess I have a problem with commitment (2003) Kudos (1998) Cookie Issue - No domain (2004) State Coalition Approves Internet Sales Tax Plan (2002)