服务器500错误 ​​- 在子文件夹移动应用程序 [英] Server 500 error - moved app in subfolder

查看:239
本文介绍了服务器500错误 ​​- 在子文件夹移动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个应用程序在我的网站的子文件夹,它工作得很好。

I developed an application in a subfolder of my website and it worked fine.

<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>

该文件是工作的罚款等等,并在应用程序中导航的index.php是不是必需的。现在我把应用程序的网站的根目录,并更改最后一行

This file was working fine so and index.php was not required to navigate within the application. Now I moved the application to root of website and changes the last line to

RewriteRule ^(.*)$ index.php/$1 [L]

现在我已经开始让内部服务器错误500,我不知道,这是我做了或需要进行不同配置的.htacces。这可能是一个问题,主持人也一样,但我想先用尽我的选择。

Now I have start getting Internal Server Error 500. I am not sure that it is something I have done or the .htacces is required to be configured differently. It might be an issue with host too, but I want to exhaust my options first.

任何帮助将AP preciated。先谢谢了。

Any help will be appreciated. Thanks in advance.

推荐答案

如果您在托管你只需要根

if you in root of hosting you just need

 <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>

如果你的网站在文件夹 /富您需要:

if you site in folder /foo you need:

<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>

如果仍然没有工作试试这个,对我来说,作品遍布:

if still not working try this, for me it works all over:

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

这篇关于服务器500错误 ​​- 在子文件夹移动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆