P
P
Peter2015-03-15 14:09:28
Apache HTTP Server
Peter, 2015-03-15 14:09:28

How to write a redirect in rewrite.conf from foo.bar/anything/ to foo.bar/anything?

Hello.
Tell me how to make a redirect for all pages ending in "/" so that it redirects to the same url, but without / at the end.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-03-16
@ShamblerR

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-l
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_URI} ^(.*/[^/\.]+)$
 RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question