laravel/laravel — pull request #3145 by jakezatecky (2014-11-20 23:12:34+00:00)
Title: Make trailing slash rewrite use relative path

The "Redirect Trailing Slash" `RewriteRule` does not use a relative path. Instead, it uses an absolute path to the web root. This causes an issue if you add `RewriteBase` to `.htaccess`.

To see this problem in action, consider the following `.htaccess:

```
RewriteBase /newbase

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
```

If we make a request to `http://some-site.com/newbase/file/`, we will be redirected to `http://some-site.com/file`, which is incorrect.

By changing the RewriteRule to `RewriteRule ^(.*)/$ $1 [L,R=301]`, you now get redirected to the correct location: `http://some-site.com/newbase/file`

Granted, you could argue that since this issue would only come up if you edit the `.htaccess` file and add the `RewriteBase` rule, you should know to change the corresponding `RewriteRule`. However, if you know little about `.htaccess` files, you might spend an hour trying to figure out why you were redirected to the web root when an extra slash was added at the end.

It's important to note that this change does not appear adversely affect anything if we still use the web root.