Forum Moderators: phranque
The .htaccess currently reads:
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^example.co.nz [nc,OR]
rewritecond %{http_host} ^www.example.co.nz [nc,OR]
rewritecond %{http_host} ^example-international.com [nc]
rewriterule ^(.*)$ http://www.example-international.com/$1 [r=301,nc]
[edited by: jdMorgan at 12:04 am (utc) on July 16, 2008]
[edit reason] Please use example.co [/edit]
How did you test? What were the results? How did these results differ from your expectations? What is the contents of your server error log when the error occurs?
Look at the form itself, and make sure the address it posts to is your canonical domain.
Look at the script that receives the post, and be sure that it does not redirect to the "wrong" domain.
We need a good, detailed technical description of the problem in order to suggest a solution. However, since all the above rewriterule does is to redirect alternate domains to your canonical domain, you are probably looking for a problem in the code that causes a redirect *back* to an incorrect domain, possibly setting up an 'infinite' redirection loop.
BTW, you can shorten/speed up the code a bit. I'd suggest:
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{HTTP_HOST} ^(www\.)?example\.co\.nz [NC,OR]
RewriteCond %{HTTP_HOST} ^example-international\.com [NC]
RewriteRule (.*) http://www.example-international.com/$1 [R=301,L]
Jim
Thanks very much for your help, I will see if I can track the error down from your suggestions. The error message that is coming up is:
The HTML form fails to specify the POST method, so it would not be correct for this script to take any action in response to your request.
If you are attempting to configure this form to run with FormMail, you need to set the request method to POST in the opening form tag, like this: <form action="/cgi-bin/FormMail.pl" method="post">
Cheers
Charles
However, you could easily check the client-server interaction on POST by using either a known-reliable* on-line server headers checker, or by using something like the "Live HTTP Headers" add-on for Mozilla/Firefox browsers. Enable the add-on, then try submitting your form; It will report all of the headers exchanged between the browser and the server.
* Some on-line server headers checkers do not report all phases of the client-server interaction. Notably, some only report the initial client request and the final server response, and do not show intervening redirection transactions.
Be sure that the form is posting to the canonical domain, so that the redirect is not invoked. If it's not, then examine the "action" tag in the form, and correct it to POST to the proper domain.
If for some reason you cannot correct the form, there is a possible work-around. Let us know.
Jim