I've been working with CI not so much, now I'm stuck with apache configuration in XAMPP stack.
Here is my conf (no .htaccess files at all):
Code:
<Directory "C:/xampp/htdocs/site.com/www">
#Indexes are disallowed to prevent statics directories listing
Options FollowSymLinks
#Redirecting 403 "forbidden" error when trying to list allowed directories and 404
ErrorDocument 403 /error/show_403
ErrorDocument 404 /error/show_404
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(img|js|style|uploads|favicon\.ico|index\.php|robot\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
DirectoryIndex index.php
</Directory>
When I follow "http://www.site.com/img" in browser, I expect redirecting to "/error/show_403", but I get default 404 CI page. That is because:
1) apache generates 403 error trying to access "img" directory index file
2) then it redirects internally to "/error/show_403" and rewrites URI to "index.php/error/show_403"
3) then CI app is executed through index.php script, BUT as URI it uses "img" instead of expected (by me, of course) "/error/show_403" and shows 404 CI error page, because there is no "img" controller
CI config variable "uri_protocol" is set to "AUTO" as suggested there. Redirects work only when I change it to PATH_INFO, but I'm not sure if it is right and I didn't test the entire website. So, the question is, should CI use redirected URI or not? And if it should can I use PATH_INFO safely?