• Resolved milo2man

    (@milo2man)


    I am trying to set up permanent redirects so that a link to
    http://www.example.com/blog/post-title/
    would be redirected to
    http://www.example.com/post-title/

    I have in my .htaccess the following

    RewriteRule blog/([A-Za-z0-9]+)$ /$1 [R=301,L]

    which doesn’t work (returns a 404).

    However, if I add a manual redirect such as

    RewriteRule blog/post-title/ /post-title/ [R=301,L]

    this works.

    I must be doing something wrong with the REGEX syntax. Can anyone help me out?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘regex help’ is closed to new replies.