使用mod_rewrite将请求传递到子文件夹中的CodeIgniter


Using mod_rewrite to pass requests to CodeIgniter in a subfolder

我正在尝试将请求从url的根传递到子文件夹,而不使用mod_rewrite重定向。(注意:我在Rackspace云站点上做这件事。)

我获取了CI.htaccess,将其移到根文件夹中,并将其从以下位置更改为:

RewriteEngine on
RewriteCond $1 !^(index'.php|images|public|robots'.txt)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]

到此:

RewriteEngine on
RewriteCond $1 !^(index'.php|images|public|robots'.txt)
RewriteBase /ci/
RewriteRule ^(.*)$ /ci/index.php/$1 [L]

这给了我一个内部服务器错误。我不相信这种情况有错误日志,这可能就是为什么我一直认为mod_rewrite是炼金术的原因。

也许你能看到出了什么问题?

谢谢!

它不是mod_rewrite,而是服务器。我能够在我的服务器上毫无问题地运行它。如果你能提供一个网址,我可以看更多。但就目前情况来看,它似乎是运行它的服务器。