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.

Comment Form Action submits to Bare Domain

March 13, 2011 9:49am

Subscribe [3]
  • #1 / Mar 13, 2011 9:49am

    Jan Paul

    74 posts

    Hi, when I look at the HTML source of a single entry with a comment form I see:

    <form id=“comment_form” method=“post” action=“http://domain.com/”

    instead of action=“http://domain.com/channelname/entryname”

    When I go to path settings in the CP the comment page URL is http://domain.com/channelname

    Right now posting a comment sends me to the bare domain, and no comment is posted.
    Am I missing some kind of setting? How do I get EE to submit to the right URL?

    Here is my code

    {exp:comment:form channel="afvallen"}
      <div id="postHere">Laat een reactie achter…</div>
    
      <textarea name="comment">{comment}</textarea><br >
    
      {if logged_out}
        <table id="userDetails"><tr>
          <td id="labelTd">Naam:</td>
          <td><input type="text" value="{name}" name="name" /></td>
        </tr><tr>
          <td>Email:</td>
          <td><input type="text" value="{email}" name="email" /></td>
        </tr></table>
      {/if}
    
      <input type="checkbox" name="notify_me" value="yes" {notify_me} />
      Hou me op de hoogte van nieuwe reacties via email
    
      
      {if logged_out}
        <input type="checkbox" name="save_info" id="save_info" value="yes" {save_info} />
        Onthoud mijn informatie
    
      {/if}
    
      {if captcha}
        
    
        <table id="captchaTbl"><tr>
          <td colspan="2" id="captchaLabel">
            Vul de anti-spam code in:
          </td>
        </tr><tr>
          <td id="captchaImg">{captcha}</td>
          <td id="captchaInput">
            <input type="text" name="captcha" />
          </td>
        </tr></table>
      {/if}
      
    
      <input type="submit" name="submit" value="Reactie Versturen" />
      {/exp:comment:form}
  • #2 / Mar 13, 2011 12:25pm

    Neil Evans

    1403 posts

    First off EE submits forms to the root of your site as this is where the index.php file is placed and this is where the script is actioned to submit the comment.
    Now i am assuming you have turned off the index.php in your settings, and are therefore using a .htaccess rewrite to make this all work.

    So by removing the index.php the form will just be redirected to the root, and that then relies on your servers default routing (index.html, index.htm, index.php, etc). So if you have an index.html file in root, that will of course not process your comment form submission, and hence not display anything either.
    If you do not have an index.html in root, then the problem might be down to your htaccess rewrite and EE support is unlikely to help you here - they will advise you to turn it off, re-add index.php in settings and see if it works that way.

    Finally, the redirect after the form is submitted:
    http://ellislab.com/expressionengine/user-guide/modules/comment/form.html#par_return

  • #3 / Mar 13, 2011 2:11pm

    Jan Paul

    74 posts

    I found the problem.

    I have a 301 to www set when the domain is visited without the www.
    My path settings still used the non www path. Changed that now and it works.

  • #4 / Mar 14, 2011 8:12am

    Sue Crocker

    26054 posts

    Thanks for the assist, nevsie.

    Jan Paul - Glad you were able to figure out what the problem was. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases