Answer the question
In order to leave comments, you need to log in
How to set up a redirect?
Good day!
There are 2 VPs of the site installed on the hosting. The second site is installed in the directory and, accordingly, is available at example.com/wordpress (the VP is also installed at example.com).
The problem is the following - when accessing the page example.com/wordpress/ there is no redirect to the URL without a slash. Although, permalinks without a slash are configured by default in the VI.
When I try to set up a redirect through regexp, I get an error 500. I searched the net, but I can’t find a specific solution.
Answer the question
In order to leave comments, you need to log in
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ /$1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question