I’ve recently ported my old website to Kirby and I’m now facing a few redirect/url issues.
My old URLs looked like this: http://domain.com/page/sub-page/
Kirby URLs looks like this (default): http://domain.com/page/sub-page
The new site which is running with Kirby does remove the trailing slash by default, but keeps the page with trailing slash accessible which leads to various problems:
all my Google entries do still refer to the old page with /
Disqus threads (which I did all map to the new URL structure) are now empty for urls with trailing slash
I think the easiest solution to fix this would be to automatically 301 redirect all URLs with trailing slash to the new URLs without trailing slash.
Now my problem: I’ve no clue how to do that (guess it would require some additional or adjusted htaccess rule). Anyone here who could help me out?
Yeah it would work. Create an array dynamically. For more than a 100 pages I would still not recommend it as it might slow down all the pages on the site if it needs to build an array every time.