Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had a site in ASP.NET, and now we moved it to WordPress. The pages in the .NET site have parameters in them.

I'd like to redirect the old pages to their new locations, but Apache doesn't seem to understand parameters, so when I write in .htaccess redirects like this, they don't work:

redirect 301 /Apps/WW/Page.aspx?ws=4ed09703-8210-4492-a86a-128c1b9822b3&page=458f828d-616d-469d-8fe2-13d3c2881df3

The solution I thought of is to create a /Apps/WW/ directory, and in it create a Page.aspx file, and redirect that to a WordPress page (called redirects), like this:

redirect 301 /Apps/WW/Page.aspx

And in the redirects page, in PHP, analyze the parameters and redirect via PHP.

Is that a good solution? It seems a little too complex, and I'm not a system person (I'm a web programmer), so I don't know any other solutions

share|improve this question
If there are similarities between your asp url parameters and the urls in word press for the same articles you should be able to use apache's mod_rewrite to rewrite the url's without use the redirects page. – topdog Sep 6 '12 at 14:26
up vote 0 down vote accepted

From speaking to the WordPress support, I found out that query parameters are not supported in redirect or rewrite rules.

They confirmed that I should write a rewrite rule in .htaccess that redirects the page without the parameters to a php file, and in that file I should use php to analyze the parameters and redirect accordingly. I don't need to create a /Apps/WW/ directory, and in it to create a Page.aspx file. The reidrect doesn't need it.

They also suggested that the php file which will do the redirecting shouldn't be in WordPress, because it will not perform very well as it will load the whole WordPress environment for any of these urls. This is not needed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.