Answer the question
In order to leave comments, you need to log in
Htaccess redirect pages after slash?
Hello everyone, please help with htaccess problem.
There is a page
site.ru/en/post-detail/50
The problem is that if you write for example site.ru/en/post-detail/50/4 then site.ru/en/post-detail/50 will open again only after to another address, so that's the actual problem, I want to redirect all requests after the slash, that is,
if a person got to site.ru/en/post-detail/70/41, then he was automatically redirected to site.ru/en/post -detail/70
but, there is one caveat, site.ru/(en - this parameter can be ru, fr, ar, pt)/post-detail/70 (and this parameter is always Numbers!)
I don’t know how bad I am explained, but I urgently need your help
Answer the question
In order to leave comments, you need to log in
and what is the problem? site.ru/en/post-detail/[0-9]{1,}/41
- numbers from 1 or more site.ru/en/post-detail/[0-9]{1,4}/41
- numbers from 1 to 4 characters site.ru/[a-z][a-z]/post-detail/[0-9]{1,}/41
- the same only exactly two letters in the range site.ru/(ru\|kz\|ua\|com)/post-detail/[0-9]{1,}/41
- or or or site.ru/[a-z][{1,3}/post-detail/[0-9]{1,}/41
- any letters in the range from 1 to 3 in the country, and any characters greater than 1 at the end.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question