Missing slash (/) in RewriteRule in Nette docs

5 years ago

messa
Member | 2
+
0
-

Hi, in Nette documentation at URL https://doc.nette.org/…ubleshooting there is this snippet:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L]

But this doesn't work for me – Apache (version 2.2.16–6+squeeze11) returns just error page 400 Bad Request, without any message in Apache error.log.

I found out there is missing slash before index.php – the correct version (so it works as expected) is:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ /index.php [L]

It's the same as in this question at StackOverflow: http://stackoverflow.com/…18348/196206

What do you think about this? Maybe it would be good to update this snippet in the Nette documentation.

Last edited by messa (2014-11-13 22:39)