We make tools that make websites.

Support Forums

   

Freeform not working since HTACCESS rewrite

Avatar
Rank

Total Posts: 8

Joined: May 7, 2007

PM

Ignore

 

Hi, avid user of freeform here, running 2.6.6.

First off, thanks very much for a quality product. We use it on nearly every site we build.

My site is http://www.eternaljewishfamily.org. I recently told HTACCESS to rewrite my URLs so “www” always appears, and ever since I did that, freeform stopped working. The notification emails don’t go out, the form doesn’t redirect or validate, and the entry isn’t added to the database. Total meltdown. I’ve tried two different methods inside HTACCESS to prepend the WWW and both cause the form to fail:

First I’m looking specifically for calls to eternaljewishfamily.org and adding the WWW:

RewriteCond %{HTTP_HOST} ^eternaljewishfamily.org [NC] 
RewriteRule 
^(.*)$ http://www.eternaljewishfamily.org/$1 [L,R=301] 

The second method is looking for anything which is NOT www.eternaljewishfamily.org and rewriting it as such:

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

But as I said both methods break freeform. Do you have any workaround for this?

Thanks very much
/\/\
Meir Deutsch

Avatar
RankRankRankRankRank

Total Posts: 13508

Joined: Oct 18, 2006

PM

Ignore

 

Just to make sure, if you remove that part of the .htaccess, Freeform works properly? smile

Signature

Avatar
Rank

Total Posts: 8

Joined: May 7, 2007

PM

Ignore

 

that’s correct

Avatar
RankRankRankRankRank

Total Posts: 13508

Joined: Oct 18, 2006

PM

Ignore

 

What happens if you try this instead? smile

Options +FollowSymlinks
RewriteCond 
%{http_host} ^eternaljewishfamily.org [NC]
RewriteRule 
^(.*)$ http://www.eternaljewishfamily.org/$1 [R=301,L] 

Signature

Avatar
Rank

Total Posts: 8

Joined: May 7, 2007

PM

Ignore

 

nope, no luck.

Avatar
Rank

Total Posts: 8

Joined: May 7, 2007

PM

Ignore

 

Hi again, still no answer?

Perhaps it helps to mention that I’ve rewritten my site’s index file as “site” instead of “index.php”. So here’s the htaccess:

RewriteEngine on
directoryIndex index
.php

RewriteCond 
%{HTTP_HOST} ^ejf.org [NC] 
RewriteRule 
^(.*)$ http://www.eternaljewishfamily.org/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^eternaljewishfamily.org [NC] 
RewriteRule 
^(.*)$ http://www.eternaljewishfamily.org/$1 [L,R=301]

<Files site>
ForceType application/x-httpd-php
</Files
Avatar
RankRankRankRankRank

Total Posts: 13508

Joined: Oct 18, 2006

PM

Ignore

 

Hi there Meir,

Is it at all possible to test this further by changing the Index back to “index.php” (instead of “site”?)?
And see what happens? smile

Signature

Avatar
Rank

Total Posts: 8

Joined: May 7, 2007

PM

Ignore

 

I’ve just tried it, with the same result.

Avatar
RankRankRankRankRank

Total Posts: 13508

Joined: Oct 18, 2006

PM

Ignore

 

Meir,

I’ll test this further. I will get back to you by tomorrow wink

Thank you for your patience…

Signature

Avatar
RankRankRankRankRank

Total Posts: 13508

Joined: Oct 18, 2006

PM

Ignore

 

Meir,

I apologize for the wait on this…

I tried adding this code to my .htaccess and I did not have any issues: wink

Options +FollowSymlinks
RewriteCond 
%{http_host} ^mysite.com [NC]
RewriteRule 
^(.*)$ http://www.mysite.com/$1 [R=301,L] 

It stored in Database and sent out notification emails.

The only other thing I can see maybe causing this issue would be server configuration, or this:

RewriteEngine on
directoryIndex index
.php 

Signature

Avatar
Rank

Total Posts: 8

Joined: May 7, 2007

PM

Ignore

 

Hey pie man,

I was able to isolate the problem to the RewriteEngine directive. The somewhat-consolidated version of my htaccess now reads:

directoryIndex index.php

# RewriteEngine On
RewriteCond %{HTTP_HOST} ^ejf.org [NC,OR]
RewriteCond 
%{HTTP_HOST} ^www.ejf.org [NC,OR]
RewriteCond 
%{HTTP_HOST} ^eternaljewishfamily.org [NC] 
RewriteRule 
^(.*)$ http://www.eternaljewishfamily.org/$1 [L,R=301]

<Files site>
ForceType application/x-httpd-php
</Files

...and the form works. Uncomment that rewrite line, and it breaks again. If there’s something in the PHP or APACHE config which might help, I can PM that to you.

THANK YOU!!

Avatar
RankRankRankRankRank

Total Posts: 13508

Joined: Oct 18, 2006

PM

Ignore

 

Hmmm… strange…

Well, it works, so I wouldn’t fiddle any further with it, haha grin

Signature

Avatar
Rank

Total Posts: 8

Joined: May 7, 2007

PM

Ignore

 

But it DOESNT work. By commenting out the RewriteEngine directive, I’m disabling all my SEO redirects, which was the point of this whole exercise.

Avatar
RankRankRankRankRank

Total Posts: 13508

Joined: Oct 18, 2006

PM

Ignore

 

Unfortunately this stuff goes beyond my knowledge… and as I mentioned before, I have been able to use the same .htaccess code on my test site, and it works.

Can you try using other functions similar, like posting a comment, or trying the Communicate Tab in the CP? smile

Signature

Avatar
Rank

Total Posts: 8

Joined: May 7, 2007

PM

Ignore

 

got it. the general configuration of my EE install had the root directory of my site as http:/eternaljewishfamily.org/ ...instead of… http://www.eternaljewishfamily.org/ ...and by adding the www to the URL, the problem resolved itself.

Like any good breakup, “It’s not you, it’s me!”

Thanks for your help!

/\/\
Meir

Avatar
RankRankRankRankRank

Total Posts: 13508

Joined: Oct 18, 2006

PM

Ignore

 

Haha, awesome! Thanks for the followup smile

Signature