Andy,
This is more complete along with some resources...
# --+---------+---------+---------+---------+---------+---------+---------+
# [4321] ( BEGIN ) PROBLEM STATEMENT
# --+---------+---------+---------+---------+---------+---------+---------+
# From: Andrew Brown <
andrew...@c18.net>
# Subject: Apache (MySQL, PHP) redirect
# Date: December 8, 2009 1:51:17 AM CST
# To: Web Authoring <
web-au...@googlegroups.com>
# Reply-To:
web-au...@googlegroups.com
#
# I need to redirect
#
#
http://c18.net/c18/c18_pages.php?nom=c18_publications
#
# to
#
#
http://c18.net/18/p.php?nom=p_toutes
#
# and tried in .htaccess
#
# <IfModule mod_alias.c>
# [lots of other redirections]
# RedirectMatch .*c18_publications
http://c18.net/18/p.php?nom=p_toutes
# [lots of other redirections]
# </IfModule>
#
# which does nothing. There are discussions all over the web on how to
# redirect ? urls, and none of the solutions proposed seem to work. Is
# there a solution? Getting a bit desperate here...
#
# AB
#
# --+---------+---------+---------+---------+---------+---------+---------+
# [4322] ( BEGIN ) ACKNOWLEDGEMENT
# --+---------+---------+---------+---------+---------+---------+---------+
# Andy,
#
# This uses mod_rewrite, to test if you have mod_rewrite enabled, look at the references below.
#
# This '. htaccess ' file worked fine for me...
#
# Best Regards,
#
# Bill Hernandez
# Plano, Texas
# --+---------+---------+---------+---------+---------+---------+---------+
# [4323] ( BEGIN ) SOLUTION REFERENCES
# --+---------+---------+---------+---------+---------+---------+---------+
# REFERENCE :
http://wiki.apache.org/httpd/RewriteQueryString
# REFERENCE :
http://www.wallpaperama.com/forums/how-to-test-check-if-mod-rewrite-is-enabled-t40.html
# --+---------+---------+---------+---------+---------+---------+---------+
# [4324] ( BEGIN ) FILEPATH : /c18/.htaccess
# --+---------+---------+---------+---------+---------+---------+---------+
RewriteEngine On
# --+---------+---------+---------+---------+---------+---------+---------+
# TEST USING LOCALHOST
# --+---------+---------+---------+---------+---------+---------+---------+
#
http://localhost/c18/c18_pages.php?nom=c18_publications
# --+---------+---------+---------+---------+---------+---------+---------+
# REDIRECT TO google
# --+---------+---------+---------+---------+---------+---------+---------+
# RewriteCond %{HTTP_HOST} ^(www\.)?localhost
# RewriteCond %{QUERY_STRING} ^nom=c18_publications
# RewriteRule /*
http://www.google.com? [R,L]
# --+---------+---------+---------+---------+---------+---------+---------+
# REDIRECT TO THE REAL PAGE
# --+---------+---------+---------+---------+---------+---------+---------+
# RewriteCond %{HTTP_HOST} ^(www\.)?localhost
# RewriteCond %{QUERY_STRING} ^nom=c18_publications
# RewriteRule /*
http://c18.net/18/p.php?nom=p_toutes [R,L]
# --+---------+---------+---------+---------+---------+---------+---------+
# NOW FOR THE REAL REDIRECT
# --+---------+---------+---------+---------+---------+---------+---------+
# --+---------+---------+---------+---------+---------+---------+---------+
# [4323] ( _END_ ) FILEPATH : /c18/.htaccess
# --+---------+---------+---------+---------+---------+---------+---------+