【发布时间】:2014-12-29 18:03:54
【问题描述】:
我相信我有这个问题的原因是因为.htaccess(尽管它们在离线和在线时是一样的)。
http://localhost/myProject/api/webservice/getUsers -> Works
http://myProjectDomain.com/api/webservice/getUsers -> Doesn't work, error: 500 Internal Error
.htaccess 从根文件夹:
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>
在我看来,我可能需要创建另一个规则?比如:
RewriteRule ^(.*)$ index.php?/api/webservice/$1 [L]
【问题讨论】:
标签: php apache .htaccess codeigniter rest