ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

form submission doesn't work with htaccess on 2.5.0

June 18, 2012 10:02am

Subscribe [1]
  • #1 / Jun 18, 2012 10:02am

    EmilyLimeRed

    44 posts

    This question may be related to a resolved thread.

    So I was using freeform, and I asked around on their support site for help and it seems to be an issue with the htaccess. It turned out that even the standard EE email forms.

    I tried this on a blank tempate:

    {exp:email:contact_form user_recipients="no" recipients="[email protected]" charset="utf-8" return="http://jandyrocks.com/contact/thank-you"}
            <h2>Support Form</h2>
    <p>        <br />
                    <label for="from">Your Email:</label></p>
    
    <p>                <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" /><br />
            <br />
            <br />
                    <label for="subject">Subject:</label></p>
    
    <p>                <input type="text" id="subject" name="subject" size="40" value="Contact Form" /><br />
            <br />
            <br />
                    <label for="message">Message:</label></p>
    
    <p>                <textarea id="message" name="message" rows="18" cols="40"><br />
                            Support Email from: {member_name}<br />
                            Sent at:  {current_time format="%Y %m %d"}<br />
                    </textarea><br />
            <br />
            <br />
                    <input name="submit" type='submit' value='Submit Form' /><br />
            <br />
    {/exp:email:contact_form}

    It redirects to the homepage despite the redirect, and no emails get sent.

    I’ve tried this:

    AcceptPathInfo On
    
    Options -Indexes
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Looks for files and directories that do not exist
    # and provide the segments to the index.php file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^/index.php
    RewriteCond $1 !.(css|js|png|jpe?g|gif|ico)$ [NC]
    RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>

    and this:

    <IfModule mod_rewrite.c>
            RewriteEngine On
    
            # Removes index.php
            RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ /index.php?/$1 [L]
    
            # If 404s, "No Input File" or every URL returns the same thing
            # make it /index.php?/$1 above (add the question mark)
    </IfModule>

    for the htaccess, but the only thing that seems to work is removing htaccess completely and putting the index.php back, which I’d rather not do.

    Is there anything else I can try? this site has to launch soon and I’m not sure what to do. for what its worth, this is a new issue, I have two sites that are having this problem, this one is new and originally built on 2.5.0, and the other was first built on 2.4, but upgraded to 2.5 before launch and the forms worked on 2.4 but not on 2.5. Did something change? I’m baffled, but I really need form submissions to work!

    thanks!

  • #2 / Jun 19, 2012 2:03pm

    Dan Decker

    7338 posts

    Hi Emily,

    I notice this:

    return="http://jandyrocks.com/contact/thank-you"

    But by chance, are you accessing the form at:

    <a href="http://www.jandyrocks.com/contact/thank-you">http://www.jandyrocks.com/contact/thank-you</a>

    ExpressionEngine will do some strange things if addresses use www, or no-www interchangeably. That’s one reason ExpressionEngine has path variables and why you generally only need to specify the template-group/template in parameters. Can you try this?

    {exp:email:contact_form user_recipients="no" recipients="[email protected]" charset="utf-8" return="contact/thank-you"}

    With this .htaccess

    <IfModule mod_rewrite.c>
            RewriteEngine On
    
            # Removes index.php
            RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ /index.php/$1 [L]
    
            # If 404s, "No Input File" or every URL returns the same thing
            # make it /index.php?/$1 above (add the question mark)
    </IfModule>

    Cheers,

  • #3 / Jun 19, 2012 2:16pm

    EmilyLimeRed

    44 posts

    Still nothing. Just redirects to the homepage and no email is sent.

  • #4 / Jun 20, 2012 3:37pm

    EmilyLimeRed

    44 posts

    Anything else I can try? Or do I just have to give up on removing index.php? This issue is holding up the site launch…

  • #5 / Jun 20, 2012 5:03pm

    Dan Decker

    7338 posts

    Hi Emily,

    I would like for us to get in for a look. Be on the lookout for an email from me.

    Cheers,

  • #6 / Jun 22, 2012 3:18pm

    EmilyLimeRed

    44 posts

    any luck?

  • #7 / Jun 25, 2012 9:57am

    EmilyLimeRed

    44 posts

    for what it’s worth, i now have 3 sites running 2.5+ (which is all the sites I have running 2.5+) with this same problem. Form submissions from any source (Freeform or official EE) don’t work with the EE supported htaccess for removing index.php. Different hosts, different versions, same problem. If I’m the only one experiencing this I’d be really surprised…

  • #8 / Jun 25, 2012 10:44am

    Dan Decker

    7338 posts

    Hi Emily,

    I got in for a look on Friday last and have yet to have succes.

    I’ll follow up with you privately. Oddly, as of yet, you are the only one to report the problem. We will get it sorted out though!

    Cheers,

  • #9 / Jun 25, 2012 10:56am

    EmilyLimeRed

    44 posts

    Thanks so much, sorry to be a pain!

  • #10 / Jun 26, 2012 5:13pm

    Dan Decker

    7338 posts

    Hi Emily,

    We got this one sorted out!

    The index.html file was interfering with ExpressionEngine’s index.php and causing a false redirect.

    I’m still sorting out the similar issues on your studio site, but I’m 99% sure that Structure is part of the issue there.

    Still looking into that one, however.

    Cheers,

  • #11 / Jun 27, 2012 10:39am

    EmilyLimeRed

    44 posts

    Thanks for the update, keep me posted.

  • #12 / Jul 09, 2012 1:45pm

    EmilyLimeRed

    44 posts

    Hi Dan,

    Have you had any luck with our site? Would be great if we could get those forms working…

    Thanks!

  • #13 / Jul 10, 2012 1:41pm

    Dan Decker

    7338 posts

    Hi Emily,

    I followed up with you in the private thread and there was no reply. Can you check the hello@ account for any missed correspondence?

    I’ve resent my last email, just in case.

    Cheers!

  • #14 / Jul 11, 2012 3:38pm

    EmilyLimeRed

    44 posts

    So to sum up, there were two different issues:
    one was that the site hiding behind the index.html file was interfering with the form submissions, and the other was that there was a conflict with www. vs no www. This setting can be specified in Admin > General Configuration.

    (I hate when I find a thread that seems relevant to me but there’s no solution because it went into private mode, so there it is!)

    Thanks to Dan for helping me through this silly but nonetheless baffling issue.

  • #15 / Jul 12, 2012 3:46pm

    Dan Decker

    7338 posts

    Hello Emily!

    My pleasure to help!

    If you need anything else, just let me know!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases