url trailing slash problem for apache
-
Hello,
I have a wordpress page setup on apache that uses disk enchaned. When I set my permalinks to trailing slashes duplicate pages are created. I found this solution in another thread (link to thread https://www.ads-software.com/support/topic/url-trailing-slash-problem/) that is for ngnix.
# BEGIN Force trailing slash set $force_trailing_slash -1; if ($request_uri ~ "^/.+[^/]$") { set $force_trailing_slash 1; } if ($request_uri ~ "^/(wp-json|\.well-known)/") { set $force_trailing_slash -1; } if ($request_uri ~ "\.(xml|jpg|png|pdf|js|css)$") { set $force_trailing_slash -1; } if ($request_uri ~ "((\?|\&)[^=]+\=[^&]+)+$") { set $force_trailing_slash -1; } if (-f $request_filename) { set $force_trailing_slash -1; } if ($force_trailing_slash = 1) { return 301 https://$host$request_uri/; } # END Force trailing slash
Since I’m not that familiar with apache can you please provide me with the equivilent solution for apache.
Thank you in advance and I look forward to your response!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘url trailing slash problem for apache’ is closed to new replies.