My goal is simply to redirect:
/jsn.php?parameters
to http://www.site2.com/jsn.php?parameters
I tried with
Redirec
Query string parameters are automatically passed, you simply want to do this:
Redirect permanent /jsn.php http://www.site2.com/jsn.php
The (.)*
doesn't work with the Redirect
directive, you were probably thinking of RedirectMatch
, but either way, you don't need it. And also (.)*
should be (.*)
, otherwise the $1 backreference would only get the first character.
Enable mod_rewrite and .htaccess through httpd.conf
and then put this code in your .htaccess
under DOCUMENT_ROOT
directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(jsn\.php)$ http://www.site2.com/$1 [L,NC,R=301]
You can use an explicit URL rewrite in your .htaccess file:
RewriteRule ^/jsn\.php\?(.*) http://www.site2.com/jsn.php?$1 [R]
Note: You need to escape . and ? because they are also regular expression characters.
If you have a problem using mod_rewrite
, post the contents of your file.