Suppose i have the following URL
subdomain.example.com/myfolder
where "myfolder" is the root folder of my CI installation (where the application folder is located).
I have the following .htaccess (Credits to Fabdrol & ElliotHaughin):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
When ever i try to access my website such as:
subdomain.example.com/myfolder/controller/etc...
It always returns a 5xx Internal Server error. However if i add
subdomain.example.com/myfolder/index.php/controller/etc...
It works perfectly. I am pretty sure there is something wrong with my .htaccess i just don't see where the problem is.
Could anyone please help me fix my htaccess? Thx
* FYI * I also tried to change the following line on my config.php
$config['index_page'] = ''; // Originally set to index.php
$config['uri_protocol'] = 'REQUEST_URI' // Originally set to AUTO
When i change the:
RewriteEngine On
RewriteBase /myfolder
It does not return 500 however, it does not display anything at all.
Just to give some information about the structure of myfolder
public_html
---|
|
|--mysubdomain_folder
| |
|-----|--myfolder (my website where index.php, .htaccess and application folder are).