Forum Moderators: phranque
I want ALL urls that follow this format to redirect to a static page on a new domain. For example: newdomain.com/new-static-page/
I can't figure out how to do this without all of the parameters coming along for the ride. So, my urls end up looking like newdomain.com/new-static-page/?param1=xx¶m2=xx¶m3=xx
I don't care about the params since the cgi script on the old domain is dead.
Thanks.
Redirect 301 /folder1/folder2/script.cgi [newdomain.com...]
This will redirect all urls w/ params after the ".cgi"...but the params get appended to the new destination (which I don't want). I've tried constructing some more advanced mod_rewrites, but I keep borkin it up.
Thanks.
RewriteRule [b]^[/b]folder1/folder2/script.cgi[b]$[/b] http://www.example.com/new-static-page/[b]?[/b] [R=301,L] The ? clears the query string from the new URL.
It redirects whether the original request has a query string, or not.
It redirects from both www and non-www on the old domain.
Never mix Redirect and RewriteRule rules in the same .htaccess file, so do make sure that all of your other rules do *not* use Redirect.