1

If I have the following in my .htaccess

    RewriteCond %{HTTP_HOST} !^www\.domain\.com$
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

When I go to submit a form on the website, forms just essentially refreshes the page. There is nothing in the database and no email is received. If I comment out those two lines, then it will work fine. In the general configuration it is set to http://www.domain.com. I'm also submitting the form with the www. in the address bar.

EE 2.6.1 Forms 3.3.5

2
  • If you inspect the form source code, what domain is the action set to? Commented Sep 10, 2014 at 19:22
  • The action is set to domain.com, not www.domain.com. Where is it pulling this from? I'm on my phone. Commented Sep 10, 2014 at 21:33

1 Answer 1

1

Thanks Derek, for pointing that out.

I edited system/expressionengine/config/config.php and changed

$config['base_url'] = "http://domain.com";

to

$config['base_url'] = "http://www.domain.com";

Then added the Rewrite back to my .htaccess

RewriteCond %{HTTP_HOST} !^www\.domain\.com$
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

After doing this, I was able to successfully submit the form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.