Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] 404 when there is no ? in the url

  • After sending a form it gets a 404 error if no “?” is in the url. This happens if you set an other style of permalinks.

    I fixed it with this, in contact-form-7/includes/classes.php
    $url .= ‘?#’ . $this->unit_tag;

    function form_html() {
    		$form = '<div class="wpcf7" id="' . $this->unit_tag . '">';
    
    		$url = wpcf7_get_request_uri();
    
    		if ( $frag = strstr( $url, '#' ) )
    			$url = substr( $url, 0, -strlen( $frag ) );
    
    		$url .= '?#' . $this->unit_tag;
    
    		$url = apply_filters( 'wpcf7_form_action_url', $url );
    		$url = esc_url_raw( $url );
    
    ...

    But it should better check if there is allready a “?” in the url.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Contact Form 7] 404 when there is no ? in the url’ is closed to new replies.