Answer the question
In order to leave comments, you need to log in
How to make one page without a slash on a site with a url with a slash?
There is a site where there is a 301 redirect to pages with a slash. There was a need to make one page so that it redirects to without a slash. (This is necessary for parsing by a third-party service, which we cannot influence, and it only works with a url without a slash).
I tried different options from the Internet. Now the following code is registered in .htaccess:
RewriteCond %{REQUEST_URI} !\?
RewriteCond %{REQUEST_URI} !\&
RewriteCond %{REQUEST_URI} !\=
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} !\/$
RewriteCond %{REQUEST_FILENAME} /food/
RewriteRule ^food/$ /food [R=301,L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question