0

I am migrating a website from vivvo cms to wordpress. Vivvo is using category pages like index.numberofthepage.html

I want to redirect urls like using regex:

https://www.example.com/mycats/index.200.html

to

https://www.example.com/mycats/page/200/

mycats could be more than one category ex cat1/cat2... and the 200 could be any number. I used :

^/index.(.*?)\.html to ^/page/$1/

But not redirecting. Thanks

  • Please add the context in which you are using the redirect rule. – fuxia Jan 6 '19 at 18:41
  • I migrated a website from vivvo cms to wordpress. Iwould like to avoid 404 errors. Vivvo is using category pages like index.**numberpage**.html – yazuk Jan 6 '19 at 18:51
  • I mean: are you using the regex in a PHP file, in an nginx config or in a .htaccess? Right now it's impossible even to guess what is wrong. – fuxia Jan 6 '19 at 19:18
  • using the regex in the plugin "Redirection" link – yazuk Jan 6 '19 at 22:53
0

Since category and page number is dynamic, you can use htaccess and use this sample rewrite rule below:

RewriteRule (.*?)/index.(.*?)\.html $1/page/$2/

You can test the regex here - https://htaccess.madewithlove.be/ and I can see that it is working as far as I have tested it.

PS: URL Redirections are cached aggresively, you need to clear you browser cache completely to make sure that you are testing it properly.

Hope this helps!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.