Support » Plugins » [Plugin: Redirection] (fixed/howto) Problem redirecting /tagname to /tag/tagname

  • Long ago, in a far distant website incarnation I had a directory named /vaio on my website that a fair number of people linked to. I’ve redirected it when I changed structures in the past with .htaccess, but now that I’m using WordPress I’ve tagged a rewrite of previous content with “vaio”.
    The problem I was having is that attempts to go to were being reconstructed to go to “”

    The solution was to change my regex from /vaio (which was matching the tag name) to “^/vaio(.*)”. The ^ leading the regex indicates that it should only match if that’s the beginning of the URL; the (.*) lets it match both the old bare directory name and the old directory name plus a filename.

    For those looking for a quick reference to the regexes, it’s using the regular PHP preg_replace() function and a quick reference is here:

  • The topic ‘[Plugin: Redirection] (fixed/howto) Problem redirecting /tagname to /tag/tagname’ is closed to new replies.