Redirect Question

Hi, I am trying to use this redirect, but it isn’t doing anything.

RewriteRule ^directory/page.shtml?ref=test$ [R=301,L]

Any ideas why it doesn’t work?


Yes: Simply that you don’t understand mod_rewrite (a RewriteRule can only examine the {REQUEST_URI} string, i.e., not the {QUERY_STRING}).

You might benefit from reading the mod_rewrite tutorial linked in my signature as it contains explanations and sample code. It’s helped may members and should help you, too.