If pages section at admin/build/securepages contains an empty line (what usually happens if someone hits ENTER after the last record) the front page toggles between HTTP and HTTPS each time you reload. The reason for this is that the empty line gets transformed into an empty or condition for the regular expression that matches urls and the empty or condition matches the front page.

I attached a simple patch that eliminates empty lines at the end of the list of pages when validating the admin form.

Comments

sanduhrs’s picture

See #286333: Blank line in securepages_secure textarea causes Homepage redirection for additional information.

Patch seems reasonable, didn't test it yet.

gordon’s picture

Status: Needs review » Needs work

This looks ok, but you need to add an update which will do fix up the current variables when the update.php is run.

adamo’s picture

Thanks for figuring this out! :)

chaloalvarezj’s picture

Thank you! you saved my day

Nathan.Ray-1’s picture

Legend! Thanks a bunch!

criznach’s picture

I believe this was causing a redirect loop in firefox on one of my sites. I removed the trailing newline and it started working immediately.

jleinenbach’s picture

Patch works. But remove the trailing newline before applying this patch.

LiveWire’s picture

MUCHOS GRACIAS! Thank you a ton.

budda’s picture

can you not just re-save the settings form to have your values trimmed?
obviously the redirection would need to be disabled on the settings form in order to get in to the site :-)

heikwan’s picture

My front page still alternates between http and https even after the patch.

mkalkbrenner’s picture

Did you save your settings again after the patch?

adr_p’s picture

Status: Needs work » Needs review
grendzy’s picture

Assigned: mkalkbrenner » grendzy
StatusFileSize
new814 bytes

It seems the front page matching is broken anyway. Here's a new patch:

BMorse’s picture

I applied this patch on version 6.x-1.9 and it seems to have worked fine. Thanks so much!

grendzy’s picture

I believe this is fixed in the 6.x-2.x branch. Please test and report back if you can.

grendzy’s picture

Status: Needs review » Fixed

There have been no further reports of this problem in the 6.x-2.x branch, and we have tests now too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.