Php 服务器500错误-在子文件夹中移动了应用程序

Php 服务器500错误-在子文件夹中移动了应用程序,php,apache,.htaccess,codeigniter,mod-rewrite,Php,Apache,.htaccess,Codeigniter,Mod Rewrite,我在我网站的一个子文件夹中开发了一个应用程序,效果很好 <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|images|swf|uploads|js|css|robots\.txt) RewriteRule ^(.*)$ /app/index.php/

我在我网站的一个子文件夹中开发了一个应用程序,效果很好

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|swf|uploads|js|css|robots\.txt)
RewriteRule ^(.*)$ /app/index.php/$1 [L]
</IfModule>
现在我开始得到内部服务器错误500。我不确定这是否是我所做的,或者.htacces是否需要进行不同的配置。这可能也是主机的问题,但我想先用尽我的选择


任何帮助都将不胜感激。提前感谢。

如果您是根托管,您只需要

 <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|images|swf|uploads|js|css|robots\.txt)
    RewriteRule ^(.*)$ /index.php/$1 [L]
    </IfModule>
如果仍然不起作用,试试这个,对我来说,它在所有地方都起作用:

RewriteEngine On
RewriteBase /foo
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /foo/index.php/$1 [L]

谢谢你,伙计,你是个救命恩人。我总是使用.htaccess文件。我想是时候学习内部结构了。@AmanAujla lol我希望有一天我能拯救一些生命,不管怎样,这些都是简单的开始问题,一旦你了解了它的工作原理,就很容易了;)
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /foo
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|images|swf|uploads|js|css|robots\.txt)
    RewriteRule ^(.*)$ /foo/index.php/$1 [L]
    </IfModule>
RewriteEngine On
RewriteBase /foo
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /foo/index.php/$1 [L]