• hello
    To change the permalink of my site from /%postname%/ to /%postname%-1/, I need a 301 redirect code and I don’t want to use a plugin.
    What code should I use?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @stellaa

    The below code snippet should redirect your old permalink structure to the new one, you can add the snippet to your website’s .htaccess file. I tested the syntax here and it looks good.

    RedirectMatch 301 ^/([^/]+)/$ /$1-1/

    Can you give it a try and let me know if it helps.

    It is a best practice to backup your website or test new changes on a staging site before implementing it on your live site.

    Best,

    • This reply was modified 1 year, 7 months ago by tarhe.
    Thread Starter stellaa

    (@stellaa)

    Hello
    This code was effective and solved my problem
    Just how can I exclude some pages like WordPress admin login page?
    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘301 redirect htaccess’ is closed to new replies.