Rewite Rule prevents values from being POSTed by HTML FORM

Sep 16, 2009 at 10:55 PM

I found the rule below on another discussion offered by Cheeso that ensures the www is appended to a domain name when it is missing. It also passes the querystring parameters as well. The rule appears to work perfectly when performing a GET such as typing the URL in the browse address bar.

RewriteCond %{HTTP_HOST} ^(?!www)([^.]+\.(.+)) [I]
RedirectRule (.*) http://www.%1$1 [I,R=301]

However, we have recently discovered that any HTML FORM tags that post to our domain that were coded without the www. prefixed to the domain name in the action attribute can no longer POST values.  For example, <FORM action=""> does not POST any values when the rule is active while <FORM action=""> works fine. When the rule is not active, both Form tags will post data.

Is there anything we can do still have the rewrite rule ensure that we get the www. prefixed (for SEO purposes) but not break forms that are also posting?


Sep 19, 2009 at 2:54 AM

Post isn't supported by IIRF at this time.  It's an open request.