Urgent Help with .htaccess

Discussion in 'Apache' started by proprod, Dec 10, 2007.

  1. #1
    Hello,

    Here is what I am trying to do in .htaccess. Everything I've tried has failed. I am using mod_rewrite and so on:

    I need to redirect
    http://www.domain.com/index.php?q=query
    Code (markup):
    to

    http://www.domain.com/index.php?search=query
    Code (markup):
    preferably with a 301 redirect. The query of course is a variable and will change, so it's a dynamic value... I have so many codes running through my head now, I can't think.

    Can someone more experienced with .htaccess please shed some light on my problem?

    Thanks so much in advance.
     
    proprod, Dec 10, 2007 IP
  2. buldozerceto

    buldozerceto Active Member

    Messages:
    1,137
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    88
    #2
    Why don't you replace $_GET['q'] with $_GET['search'] in you script?
    In this case it would be better than .htaccess

    Anyway:

    RewriteEngine on
    RewriteBase /
    RewriteRule index.php?q=(.*)^ /index.php?search=1$
     
    buldozerceto, Dec 11, 2007 IP