title: Cannot perform POST request in CodeIgniter
body: <p>I have a form in a page that uploads user data onto my online server using the CodeIgniter framework. I can access the form page normally using the HTTPS protocol, but when I try to submit the form using POST, I am given a <code>403 Forbidden: You don't have permission to access &lt;url&gt; on this server.</code> error. What could be the issue?</p>
  
  <p>The <code>.htaccess</code> file:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond $1 !^(index\.php|resources|images|robots\.txt)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  </code></pre>
  
  <p>My form attributes in the view. The <code>$base_url</code> variable is the <code>base_url()</code> configured in <code>config.php</code>:</p>
  
  <pre><code>&lt;form name="new_article_form" id="new_article_form" method="POST" action="&lt;?php echo $base_url; ?&gt;entries/insert_article" enctype="application/x-www-form-urlencoded"&gt;
  ...
  &lt;/form&gt;
  </code></pre>
  
  <p>Am I missing something?</p>
  
  <p>Edit:
  The full form as requested. It does not use the form_helper from CI for now. Currently working on that:</p>
  
  <pre><code>&lt;form name="new_article_form" id="new_article_form" method="POST" action="&lt;?php echo $base_url; ?&gt;entries/insert_article" enctype="application/x-www-form-urlencoded"&gt;
  
      &lt;p&gt;Blog Name:&lt;/p&gt;
      &lt;select name="blog" id="blog" required&gt;
      &lt;?php
      echo $blogs; //pre-formatted &lt;option&gt; list from controller
      ?&gt;
      &lt;/select&gt;
      &lt;p&gt;Article Title:&lt;/p&gt;
      &lt;input type="text" name="title" id="title" required /&gt;
  
      &lt;p&gt;Article Author:&lt;/p&gt;
      &lt;input type="text" name="author" id="author" value="Own" required /&gt;
  
      &lt;p&gt;Authoring Date:&lt;/p&gt;
      &lt;input type="datetime-local" name="auth_date" id="auth_date" value="&lt;?php echo date("d-m-Y"); ?&gt;" required /&gt;
  
      &lt;p&gt;Article URL:&lt;/p&gt;
      &lt;input type="text" name="url" id="url" required /&gt;
      &lt;p&gt;Summary:&lt;/p&gt;
      &lt;textarea name="summary" id="summary" style="resize:none" class="text" rows="10" cols="40" required &gt;&lt;/textarea&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;button name="reset" id="reset" type="reset"&gt;Clear&lt;/button&gt;&amp;nbsp;
      &lt;button name="submit" id="submit" type="submit"&gt;ADD&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I just rewrote the whole form using CI's form helper lib, and am still getting the same error. The form request is not even getting to the controller nor the main index.php file, it is being terminated before that as no POST data reaches the main index.php file at the root of the framework. So this may be a permissions issue or something else before that. NB: am on a shared website hosting platform just in case anyone's wondering, and am currently using a self-signed certificate for online SSL testing.</p>
  
  <p>UPDATE 2:</p>
  
  <p>routes.php:</p>
  
  <pre><code>&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  $route['default_controller'] = "main";
  $route['404_override'] = '';
  
  /* End of file routes.php */
  /* Location: ./application/config/routes.php */
  </code></pre>
  
  <p>config.php:</p>
  
  <pre><code>&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  $config['base_url'] = 'https://&lt;***full_url***&gt;/';
  $config['index_page'] = '';
  
  $config['uri_protocol'] = 'AUTO';
  
  $config['url_suffix'] = '';
  $config['language'] = 'english';
  $config['charset'] = 'UTF-8';
  $config['enable_hooks'] = FALSE;
  $config['subclass_prefix'] = 'BG_';
  $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
  
  $config['allow_get_array']      = TRUE;
  $config['enable_query_strings'] = FALSE;
  $config['controller_trigger']   = 'c';
  $config['function_trigger']     = 'm';
  $config['directory_trigger']    = 'd'; // experimental not currently in use
  
  $config['log_threshold'] = 2;
  $config['log_path'] = '';
  $config['log_date_format'] = 'Y-m-d H:i:s';
  $config['cache_path'] = '';
  $config['encryption_key'] = '';
  $config['sess_cookie_name']     = 'ci_session';
  $config['sess_expiration']      = 7200;
  $config['sess_expire_on_close'] = FALSE;
  $config['sess_encrypt_cookie']  = FALSE;
  $config['sess_use_database']    = FALSE;
  $config['sess_table_name']      = 'ci_sessions';
  $config['sess_match_ip']        = FALSE;
  $config['sess_match_useragent'] = TRUE;
  $config['sess_time_to_update']  = 300;
  
  $config['cookie_prefix']    = "";
  $config['cookie_domain']    = "";
  $config['cookie_path']      = "/";
  $config['cookie_secure']    = FALSE;
  $config['global_xss_filtering'] = FALSE;
  
  $config['csrf_protection'] = FALSE;
  $config['csrf_token_name'] = '************';
  $config['csrf_cookie_name'] = '*************';
  $config['csrf_expire'] = 3600;
  $config['compress_output'] = FALSE;
  $config['time_reference'] = 'local';
  
  $config['rewrite_short_tags'] = FALSE;
  
  $config['proxy_ips'] = '';
  
  /* End of file config.php */
  /* Location: ./application/config/config.php */
  </code></pre>
  
  <p>entries controller:</p>
  
  <pre><code>&lt;?php 
  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Entries extends CI_Controller 
  {
  public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;helper('url');
          $this-&gt;load-&gt;helper('form');
          $this-&gt;load-&gt;model("entries_model", "entries");
      }
  
      public function index($data = array())
      {
  
          ...//other code
  
          $form_attrs = array("name"=&gt;"new_article_form", "id"=&gt;"new_article_form", "enctype"=&gt;"application/x-www-form-urlencoded");
  
          $form = form_open(base_url()."entries/insert_article", $form_attrs);
  
          //... form entries
  
          $form .= form_close();
  
          $data["form"] = $form;
  
          $this-&gt;load-&gt;view('entries_view', $data); //the form is displayed on the view properly, no errors present, exactly as shown above
      }
  
      public function insert_article()
      {
          $blogID = $this-&gt;input-&gt;post("blog");
          $title = mb_convert_encoding($this-&gt;input-&gt;post("title"), "UTF-8");
  
          //... other insert code
  
          $this-&gt;index($data);
      }
  
      public function blogs($result = "")
      {
          //... blogs view function
          $this-&gt;load-&gt;view('blogs_view', $data);
      }
  }
  
      //... other code
  ?&gt;
  </code></pre>
  
  <p>NB: From what I can conclude, the error is on the server side, as POST requests from the mobile app using the site are able to get through, but browser POST requests specifically with form data are not getting through. GET requests are getting through fine though. The only error visible is also on the server error logs stating that the "404.html" page cannot be found. Anyone know what could be refusing the connections on the server side?</p>
  
  <p>UPDATE: </p>
  
  <p>HTTP Headers:</p>
  
  <pre><code>Host: &lt;***site***&gt;
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101     Firefox/40.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Accept-Encoding: gzip, deflate
  Referer: https://&lt;***site***&gt;/entries/blogs
  Cookie: PHPSESSID=ba4ce8f6cf3ebd19a443763fa8a187c0
  Connection: keep-alive
  </code></pre>