• I have a dictionary website using WordPress. The previous URL for a term like “Pixel” is mydomain.com/pixel. I changed the permalink structure so the new URL for this term looks like mydomain.com/definition/pixel. Now I want to redirect previous urls for all terms of my dictionary to new ones. I have some pages in my website such as FAQ and Contact-us that i don’t want to redirect. So I used the following RedirectMatch:
    RedirectMatch ^/((?!contect-us|FAQ|definition).*)$ /definition/$1
    But it does not work properly. all of my website redirects to mydomain.com/definition/index.php
    I have the following redirect in my htaccess generated by wordpress.
    RewriteRule . /index.php [L]
    I think this rule causes the problem. Any help to solve it?

The topic ‘Redirect to a subdirectory using RedirectMatch’ is closed to new replies.