Enforcing a trailing-slash policy #496
-
DescriptionIs there a way to force a trailing slash policy in ziggy? My .htaccess does 301 to a link with '/' at the end, however I would like the links on the page to appear with '/' at the end. Unfortunately
does not always work well. I would like to do this in the app.js file (my main javascript file) Thanks in advance for your reply. Greetings |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There isn't a way to do this within Ziggy itself, no, but you can just wrap Ziggy's Something like this should work, but let me know if you still have questions! // Assuming the `route()` function already exists...
appRoute = (...args) => route(...args) + '/'; |
Beta Was this translation helpful? Give feedback.
There isn't a way to do this within Ziggy itself, no, but you can just wrap Ziggy's
route()
function to do it yourself.Something like this should work, but let me know if you still have questions!