S
S
Shimpanze2019-03-05 05:58:28
Apache HTTP Server
Shimpanze, 2019-03-05 05:58:28

How to write such a rule for .htaccess?

Hello!
Now on the site url of the form: site.ru/2019/01/05/53762.
How to write a .htaccess rule that redirects to an address like: site.ru/53762?
And how to force search engines to re-index links to new ones (to remove this rule in a month)?
Thanks a lot!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-03-05
@Shimpanze

RewriteRule ^[0-9]{4}/[0-9]{2}/[0-9]{2}/([0-9]{1,})& /$1 [R=301,L]

Only in my opinion you need to escape the slash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question