PLZ help - .htaccess phrase-match MASS 301 redirection question with weird URLs.

Discussion in 'Apache' started by denniss, Mar 9, 2010.

  1. #1
    Hi all,

    I'm wondering whether anyone can help me out. Recently we disabled a software we no longer want to use.

    However it has some 1,800 cached in Google pages, so I don't want them to go to a 404 error page.

    So what I need is a GLOBAL .htaccess redirect for URLs that contain a specific keyphrase, namely: story.*

    I tried to do it, but ran into a problem since I don't know how to redirect the full URL with weird characters.

    Here is an example of some file names we have on our site:
    /story.php?id=18780
    /story.php?id=21367
    /story.php?id=19993
    /story.php?id=16700&cmd=dugg
    /story.php?id=21370&cmd=dugg

    All I'd like to do is reroute ALL pages that match story.* (no matter of further extension) to the root / directory of the site, since as I mentioned before this software is now discontinued.

    Your help is greatly appreciated.
     
    denniss, Mar 9, 2010 IP
  2. denniss

    denniss Well-Known Member

    Messages:
    591
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    120
    #2
    UPDATE:

    Here is the best I could come up with:

    This redirects all files that contain "story." to http://www.mydomain.com? ... if I remove the ? after mydomain.com it doesn't translate things correctly (displays something like http://www.mydomain.com?id=19993).

    That's the best I could come up with and it still doesn't work. :/
     
    denniss, Mar 10, 2010 IP