title: 403 error on moving codeigniter to live server
body: <p>I have a Codeigniter site that works fine on my local XAMPP server, but now I've moved it to shared hosting I get a 403 forbidden error when I click on any link. The homepage displays fine, but any page with a slug produces the 403 error. E.g.</p>
  
  <pre><code>http://xxxxxxxxxxx/~test/
  </code></pre>
  
  <p>works fine</p>
  
  <pre><code>http://xxxxxxxxxxx/~test/about-us
  </code></pre>
  
  <p>produces the 403 error.</p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/6601263/403-error-when-moving-codeigniter-app-from-localhost-to-qa-server">this question</a>, but my application folder and its subfolders and files already all have permissions of 755. </p>
  
  <p>My Base Url is set to </p>
  
  <pre><code>http://xxxxxxxxxxx/~test/
  </code></pre>
  
  <p>My .htaccess looks like this:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|resources|robots\.txt|static)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  </code></pre>
  
  <p>EDIT: If it makes a difference, I should say that I modified the core router.php (I know it's better to create my own MY_router.php, but anyway) to allow hyphens in the URL:</p>
  
  <pre><code>$segments = $this-&gt;_validate_request(str_replace('-','_',$segments));
  </code></pre>
  
  <p>but I tried changing it back to </p>
  
  <pre><code>$segments = $this-&gt;_validate_request($segments);
  </code></pre>
  
  <p>and it made no difference.</p>
  
  <p>EDIT 2:</p>
  
  <p>Another update. It works with URLs like this:</p>
  
  <pre><code>http://xxxxxxxxxx/~test/about-us/consultancy
  </code></pre>
  
  <p>just not with this</p>
  
  <pre><code>http://xxxxxxxxxx/~test/about-us
  </code></pre>
  
  <p>although this <em>does</em> work:</p>
  
  <pre><code>http://xxxxxxxxxx/~test/about-us/
  </code></pre>