Skip to content

Commit 6109d60

Browse files
author
Daniel Martin
committed
Use (?s) option in RewriteRules
The reason for doing this is that apparently some Apache binaries are distributed linked to a PCRE library that considers character 0x85 a new line like character. On such Apache instances, the redirect rules without (?s) will not work for URLs containing characters that have a 0x85 byte in their UTF-8 expansion.
1 parent 28c37ec commit 6109d60

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.htaccess

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<IfModule mod_rewrite.c>
22
RewriteEngine on
33
RewriteRule ^$ public/ [L]
4-
RewriteRule (.*) public/$1 [L]
5-
</IfModule>
4+
RewriteRule ((?s).*) public/$1 [L]
5+
</IfModule>

public/.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ AddDefaultCharset UTF-8
33
RewriteEngine On
44
RewriteCond %{REQUEST_FILENAME} !-d
55
RewriteCond %{REQUEST_FILENAME} !-f
6-
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
6+
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
77
</IfModule>

0 commit comments

Comments
 (0)