BR0C0LLI
Newbie
- Nov 18, 2022
- 10
- 1
After web migration and new URL architecture, I need to redirect old URLs because I am getting lot of 404.
Old URL examples:
domain.com/blog/vse-o-produktech/395-vybaveni-a-doplnky-pro-vasi-pergolu
domain.com/blog/71-prave-realizujeme/464-kdo-nainstaloval-pergolu-dominiku-haskovi-jagr
New URL:
domain.com/vybaveni-a-doplnky-pro-vasi-pergolu
domain.com/kdo-nainstaloval-pergolu-dominiku-haskovi-jagr
So red parts need to be removed.
I have tried put this REGEX to my .htaccess:
But it does not work. In online regex tester tools (like regextester.com) it works.
If you can made up valid code I will pay you $10
I will have more jobs like this, so we can colab to the future.
Old URL examples:
domain.com/blog/vse-o-produktech/395-vybaveni-a-doplnky-pro-vasi-pergolu
domain.com/blog/71-prave-realizujeme/464-kdo-nainstaloval-pergolu-dominiku-haskovi-jagr
New URL:
domain.com/vybaveni-a-doplnky-pro-vasi-pergolu
domain.com/kdo-nainstaloval-pergolu-dominiku-haskovi-jagr
So red parts need to be removed.
I have tried put this REGEX to my .htaccess:
like this:blog/([A-Za-z0-9]+(-[A-Za-z0-9]+)+)/[0-9]+-
<IfModule mod_rewrite.c>
RewriteCond %{THE_REQUEST} ^GET\ /blog/([A-Za-z0-9]+(-[A-Za-z0-9]+)+)/[0-9]+-
RewriteRule ^blog/([A-Za-z0-9]+(-[A-Za-z0-9]+)+)/[0-9]+- $1 [L,R=301]
</IfModule>
But it does not work. In online regex tester tools (like regextester.com) it works.
If you can made up valid code I will pay you $10
I will have more jobs like this, so we can colab to the future.