RewriteMod help for conditional redirect

Discussion in 'Apache' started by marcnyc, May 4, 2010.

  1. #1
    Hello, I was wondering if anyone can help me figure this out.


    I would like a URL like this:
    http://domain.com/interviews/index.php?interview=Anything
    or like this:
    http://domain.com/interviews/?interview=Anything
    to redirect to a page like this:
    http://domain.com/?s=Anything+interview&searchsubmit=

    I have come up with this code (the first block of it, the second block was already in my root's .htaccess file due to an installation of WordPress):
    
    # BEGIN Interviews
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{QUERY_STRING} interview=(.*)
    RewriteRule ^interview=.* /?s=%1+interview&searchsubmit= [L]
    # END
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    Code (markup):
    Can anybody help me figure out what I am doing wrong?
     
    marcnyc, May 4, 2010 IP
  2. marcnyc

    marcnyc Peon

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    bump bump ;-)
     
    marcnyc, May 6, 2010 IP