WordPress.org

Support

Support » How-To and Troubleshooting » Using custom field to redirect.

Using custom field to redirect.

  • hummelmose
    Participant

    @hummelmose

    Hi there.

    I’m currently running a asp.net site, and I’m ready to convert it to WordPress. But I want to maintain my current SEO ranking, so I need to make my site answer on old url as well.

    The old url is:

    /indhold/templates/design.aspx?articleid=9733

    I have made PHP answer on aspx extensions, but can anyone help me making a php side that takes the articleid, query it on a custom field in wordpress, and then make a 301 redirect to the new wordpress url.

    I’m not worldchamp in PHP, since I come from the .net world, but I’m willing to learn 🙂

Viewing 1 replies (of 1 total)
  • Rod Whiteley
    Member

    @rod-whiteley

    My first thought would be to use the template_redirect action to detect that kind of URL and take appropriate action, because I’m familiar with it. It doesn’t have to provide a WordPress template. It can do something else entirely and exit.

    There might be a clever solution using WP_Rewrite, but I’ve never tried that.

Viewing 1 replies (of 1 total)
  • The topic ‘Using custom field to redirect.’ is closed to new replies.