How To Do A Conditional 301 Redirect?



I have a wordpress site (php/apache) .
I need to create a 301 "wildcard" redirect - I think I can add it to my htaccess file. Here is what I need to do :
I have some affiliate links that look like this:http://mydomain.com/page-topic/?utm_sour…
utm_medium=website&utm_campaign=your email
/?utm_source=
will always be
/?utm_source=
Everything after /?utm_source= will vary.
I want to setup a redirect- for any URL that contains http://mydomain.com/page-topic/?utm_sour…
redirected to my homepage- http://mydomain.com/
-------
Once working properly I should be able to visit:http://mydomain.com/page-topic/?utm_sour…
utm_medium=blah&utm_campaign=whatever
should redirect to http://mydomain.com
-------------
Lastly- I would love to have this be conditional - and only apply to all search engines- but if that is not possible- a reidrect for all

Related posts:

  1. Seo Advertising Help Please? im about ready to start a wordpress blog affiliate marketing business and i was wondering if it is possible for me to make it to...
  2. Do You Think A Blog On Ways For Teens To Make Money Is A Good Adsense Blog? Tell me if there is a large enough audience for this, enough content to blog about on this topic and if the topic will work...
  3. I Do Not Own A Website. What Type Of Website Can I Create To Make Money Online Through Google Adsense? If you want to create a website where you can earn money through google adsense, I'd suggest you look into Site Build It. I have...
  4. How Do I Get My Home Business Website Listed On Search Engines For No Money? A friend who has an earthlink account asked me to throw up a simple site to showcase his home business, get it listed, and spend...
  5. Am I Monetizing My Site The Right Way? I have amazon associates ads and I can't use Adsense because they don't approve of my content so I'm using an Adsense alternative called Smowtion...
  6. Is My Seo Correct Or Am I Way Off? Okay I think I finally have it down and just want to see if everyone out there agrees or not. 1) Find your niche 2)...
  7. How Can One Make Money From Adsense On Net? there is about only one trick to make money from adsense, and that would be - TRAFFIC TRAFFIC = MONEY Search Engine Marketing build up...
  8. Do You Think A Blog About Inventing Will Be Successful For Adsense? This blog will not give inventing history or anything like that but tips, such as good 3d printing machines, tips to get a idea ,...
  9. What is IPO differential pricing? - Stock Market Forum, Penny ... If you see advertising on this page, admin - the author of this content - probably isn't seeing any of that revenue.Visit What is IPO...
  10. How Do You Know If Your Blooger Page Is Deleted? While working on my blog on Blogger tonight, I got this following message: "We're sorry, but we were unable to complete your request." They kept...


Printed from: http://makemoneyonlineblog.in/2009/12/14/how-to-do-a-conditional-301-redirect/ .
© 2010.

1 Comment  

  • Web Design Midlands says:

    In your .htaccess file this should redirect everything to your home page.
    RewriteRule ^page-topic/?utm_source=(.*)$ http://mydomain.com/ [L,R=301]
    Haven't tested it though but think it'll work.
    Regards
    Web Design Midlandshttp://www.webdesign-midlands.co.uk

RSS feed for comments on this post

  • Categories

  • Google Translator

      Translate to: