I believe the reason why I have this problem is because of .htaccess
(although they are the same in offline and online).
http://localhost/myProject/api/webservice/getUsers -> Works
http://myProjectDomain.com/api/webservice/getUsers -> Doesn't work, error: 500 Internal Error
.htaccess from root folder:
Options -Indexes
Options +FollowSymLinks
# Set the default file for indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
# activate URL rewriting
RewriteEngine on
# do not rewrite links to the documentation, assets and public files
RewriteCond $1 !^(index\.php|public|images|robots\.txt)
# do not rewrite for php files in the document root, robots.txt or the maintenance page
RewriteCond $1 !^([^\..]+\.php|robots\.txt)
# but rewrite everything else
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
ErrorDocument 404 index.php
</IfModule>
In my point of view I might need to create another rule? Something like:
RewriteRule ^(.*)$ index.php?/api/webservice/$1 [L]