Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a somewhat strange problem. A client has moved their site to Wordpress. They use a service for link exchanges that has a Wordpress plugin. The issue is that the new links pages use a query string to display the correct content and I cannot figure out how to redirect the old URLs correctly.

Old URLs look like this: domain.com/link/category-name.html

The plugin makes them look like this in WP: domain.com/links/?page=category-name.html

How in the world can I get the redirect to work properly?

Here's what I have tried:

Redirect 301 /link/actors.html http://www.artisticimages.biz/links/?page=actors.html
Redirect 301 /link/actors.html http://www.artisticimages.biz/links/%3Fpage=actors.html
Redirect 301 /link/actors.html http://www.artisticimages.biz/links/\?page=actors.html

But none of those have worked. Any help is greatly appreciated!

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

I dont think its possible as the redirect only deals with the url and not the parameters. please see this question on stack overflow

share|improve this answer
    
OK, I got it. I'm a novice with .htaccess. Could I rewrite the URL then redirect it? So set up a rewrite rule and then set my redirects? Would that be the best (or at least better) solution? –  dkmojo Oct 25 '12 at 23:09
    
it's a long time since I did somthing like this but that should work. –  MikeT Oct 25 '12 at 23:20
    
Awesome! I've never had to do anything like this before with a redirect and the plugin that the links company has creates the URLs dynamically which has caused this issue. Thank you for your input, I really appreciate it! –  dkmojo Oct 25 '12 at 23:22
add comment

The first format in your post works for me and looks very correct.

I put the following config in my own server (a CentOS box) and it works.

http://turco.com/link/actors.html -> http://www.artisticimages.biz/links/?page=actors.html

[/etc/httpd/conf.d 4]# cat redirect.conf
Redirect 301 /link/actors.html http://www.artisticimages.biz/links/?page=actors.html

It works great and redirects to your server with the question mark. I am using Firefox.

share|improve this answer
    
Thanks. But what part of your answer is the config portion? Sorry but I'm not very familiar with setting conf files. Could you elaborate as to what and where I need to place the config? My client has their site hosted with GoDaddy. Do I need to contact them? Thanks! –  dkmojo Oct 27 '12 at 14:10
add comment

Your Answer

 
discard

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.