Welcome to WebmasterWorld Guest from 54.224.83.221

Forum Moderators: Ocean10000 & phranque

Apache 2.4 - substitution carriage return not working

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

New User

joined:July 9, 2018
posts: 1
votes: 0


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
9:20 pm on July 9, 2018 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14905
votes: 649


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?
1:12 pm on July 10, 2018 (gmt 0)

New User

joined:July 9, 2018
posts: 1
votes: 0


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.
5:24 pm on July 10, 2018 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14905
votes: 649


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?