WordPress.org

Ready to get started?Download WordPress

Forums

Using custom field to redirect. (2 posts)

  1. hummelmose
    Member
    Posted 7 months ago #

    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 :-)

  2. Rod Whiteley
    Member
    Posted 7 months ago #

    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.

Reply

You must log in to post.

About this Topic