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.
http://xxxxxxxxxxx/~test/
works fine
http://xxxxxxxxxxx/~test/about-us
produces the 403 error.
I saw this question, but my application folder and its subfolders and files already all have permissions of 755.
My Base Url is set to
http://xxxxxxxxxxx/~test/
My .htaccess looks like this:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt|static)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
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:
$segments = $this->_validate_request(str_replace('-','_',$segments));
but I tried changing it back to
$segments = $this->_validate_request($segments);
and it made no difference.
EDIT 2:
Another update. It works with URLs like this:
http://xxxxxxxxxx/~test/about-us/consultancy
just not with this
http://xxxxxxxxxx/~test/about-us
although this does work:
http://xxxxxxxxxx/~test/about-us/