Skip to content

Commit

Permalink
Trailing slash recipe: Add note about double redirects
Browse files Browse the repository at this point in the history
Closes #2092.
  • Loading branch information
lukasbestle authored Oct 25, 2023
1 parent 5a08753 commit 5785334
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ RewriteCond %{REQUEST_URI} !^/media
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]
```

<warning>
Note that Kirby's page URLs don't contain a trailing slash. Forcing URLs to trailing slashes will cause your site to redirect every link that you render using `$page->url()`. The links will still work, but will need two browser requests. So forcing a trailing slash is only recommended when migrating from a different CMS that used trailing slashes.
</warning>

## Enforce URLs without trailing slash

The extra rules for the Panel are not needed if you want to enforce URLs without a trailing slash, so these two lines will do the job:
Expand Down

0 comments on commit 5785334

Please sign in to comment.