Forum Moderators: phranque

Message Too Old, No Replies

Apache 2.4 - substitution carriage return not working

         

likemax

8:32 pm on Jul 9, 2018 (gmt 0)

5+ Year Member



Hi all,

I upgrated my Apache Web server from version 2.2 to 2.4.
Unfortunately, I have an error with mod_substitution: this regex is no longer working and Apache is crashing because of carriage return:
Substitute "s/[\n\t\r]//i"

code:

<Location /concerto/Concerto.htm>
AddOutputFilterByType SUBSTITUTE text/html
# remove the comments in the page that starts with "//Only" because it causes problems if we remove the return carriage
Substitute "s|//Only(.*)||i"
# remove all the line feed and tabs because the substitute command on Apache does not support multi-lines regex
Substitute "s/[\n\t\r]//i"
</Location>

Any help please?

Thank you in advance.
Likemax

lucy24

9:20 pm on Jul 9, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It may be a copout, but could you sneak around it by replacing all \s+ with " " instead of specifying which spaces are to be replaced? (Seems like that's what you'd want to do anyway. Tabs and line feeds shouldn't be deleted, they should be replaced with a single space.)

Isn't "i" kinda superfluous when dealing strictly with non-alphabetics?

likemax

1:12 pm on Jul 10, 2018 (gmt 0)

5+ Year Member



Hi lucy24,
Thank you for your quick replay.
I tried your solution by replacing all \s+ with " " and removing "i" but same result. It's not working.

lucy24

5:24 pm on Jul 10, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Dang.

:: looking vaguely around for someone who speaks Apache (I don't, and am not yet on 2.4 so I can't experiment on the test site) ::

phranque? whitespace? long string of other people whose name I've forgotten?