0

I don't know if it is possible to achieve this. I want to create custom rewrite rule to redirect an URL to other one.

For now, my URL is like :

/store-director/storeName-directoreName/

I want my URL to be like :

/store/storeName/directorName

I tryed something like this :

add_rewrite_rule('^store/([^/]*)/([^/]*)/?','store-director/$matches[1]-$matches[2]','top');

It doesn't work, it redirects to an other page...

6
  • You need to rewrite one url or multiple?
    – BenB
    Commented Jun 30, 2017 at 18:53
  • Multiple URL with dynamic storeName and directorName. Commented Jun 30, 2017 at 18:54
  • How many urls? more than 1000?
    – BenB
    Commented Jun 30, 2017 at 18:55
  • Almost 50 URL to rewrite Commented Jun 30, 2017 at 18:56
  • What is /storeName-directoreName/? Is that the slug of a page?
    – Milo
    Commented Jun 30, 2017 at 22:14

1 Answer 1

0

You could load a csv file to Simple 301 redirect plugin with the url's you want to rewrite. It's simple to use and works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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