D
D
Denwebart2015-06-27 18:37:49
Apache HTTP Server
Denwebart, 2015-06-27 18:37:49

How to remove duplicate slashes in Laravel 4.2 url and put a closing slash on categories?

During the development of the project on Laravel 4.2, I discovered that a URL like example.com//////news is available , that is, you can substitute an infinite number of slashes and get page duplicates. How to fix?
And how to make it so that at the end of the URL for a category (if it does not have a .html extension) a closing slash is delivered, indicating that articles are contained there?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
use_strict, 2017-04-05
@use_strict

RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
RewriteRule . %1/%2 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question