Why I am getting 'Forbidden' when I try to

2019-07-09 03:51发布

问题:

#Deny from all
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|assets|images|upload|uploads|html|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

This is my current .htaccess file and site is inside a sub-domain directory called clients. You can access the site here: http://clients.creditblitz.ca/

回答1:

Your given url is redirect to 404 page

http://clients.creditblitz.ca/authenticate

But access below url redirect to 200 response

http://clients.creditblitz.ca/index.php/authenticate

So, Please remove the index.php in codeIgniter Framework config file

$config['index_page'] = '';

And apply below htaccess coding

RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|css|images|robots\.txt)
RewriteRule .* index.php/$0 [PT,L]