Y
Y
Yury Bondaruk2022-01-06 20:56:26
htaccess
Yury Bondaruk, 2022-01-06 20:56:26

How to remove id records via htaccess (not via post links)?

Hello!

It is necessary to remove the last 4 characters for the record (id) through the htaccess rule. You can't use permalinks (since this link is sent via onesignal in the android application and the post ID is taken from it)

example.ru/post1/1998 -> example.ru/post1

thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2022-01-06
@drnkwtr

RewriteRule ^(.+)\/([0-9]{4})(?:\/|)$ /$1? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question