views:

16

answers:

1

So I've got http: //www .domain.com/page.cfm?var=test redirecting to http: //www .domain.com/404.cfm?var=test

I don't want the variable string included in the url at redirect. Kicker is I don't have QSA in the condition.

So is QSA on by default for IIS Mod-Rewrite? If so how can I turn it off?

RewriteRule ^(?:factory_outlets|public_stock_detail)\.(?:html|cfm) http://www.domain.com/404.cfm [R=404,L]
A: 

In general you need to specify a query in your substitution like this:

RewriteRule ^(?:factory_outlets|public_stock_detail)\.(?:html|cfm) http://www.example.com/404.cfm? [R=404,L]

But an internal rewrite should suffice:

RewriteRule ^(?:factory_outlets|public_stock_detail)\.(?:html|cfm) /404.cfm [R=404,L]

Furthermore do external redirects always yield in a 3xx response.

Gumbo
Adding ? to the end of the redirect did the trick. Thanks.Not sure what you are referring to regarding 3xx redirects, I didn't say anything about those.
CreativeNotice
@CreativeNotice: Specifying an absolute URL as your destination does always yield in an external redirect. And that’s always a 3xx response no matter what your *R* flag says.
Gumbo