在此服务器上找不到请求的 URL/frontend/ru/site/login/ [英] The requested URL /frontend/ru/site/login/ was not found on this server

查看:62
本文介绍了在此服务器上找不到请求的 URL/frontend/ru/site/login/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我的项目在 windows(在 apache 服务器上)运行得很好,然后我将我的项目移到了 ubuntu 12.04(apache2 服务器),但我的项目不起作用.

I have a problem, that my project working very nice on windows(on apache server ),then I moved my project to ubuntu 12.04 (apache2 server), but my project do not working.

阿帕奇2

php 5.3.10

mysql 5.5.29-ubuntu0.12.04.2

mysql 5.5.29-ubuntu0.12.04.2

关于萤火虫:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /frontend/ru/site/login/ was not found on this server.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at test.local Port 80</address>
</body></html>

但我有 URL /frontend/ru/site/login/.

ma​​in.php:

// uncomment the following to define a path alias
Yii::setPathOfAlias('site',dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'Biotrack Backend',
    'language' => 'ru',
    'defaultController'=>'company/list',

    // preloading 'log' component
    'preload'=>array('log', 'ELangHandler'),

    // autoloading model and component classes
    'import'=>array(
        'site.common.models.*',
        'site.common.components.*',
        'application.models.*',
        'application.components.*',
        'application.components.helper.*',
        'application.modules.rights.*',
        'application.modules.rights.components.*',
    ),

    'modules'=>array(

        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'795138462',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters'=>array('127.0.0.1','::1'),
            'generatorPaths'=>array(
                'site.common.gii',   // псевдоним пути
                //'application.gii',
            ),
        ),

        'webshell'=>array(
            'class'=>'ext.webshell.WebShellModule',
            // when typing 'exit', user will be redirected to this URL
            'exitUrl' => '/',

推荐答案

你没有提供足够的信息,所以我们必须猜测,但我相当确定问题出在 apache 重写模块中.首先,确保您的 .htaccess 文件包含以下内容:

You're not giving enough information, so we have to guess, but I'm fairly sure that the problem is in apache rewrite module. First of all, make sure your .htaccess file contains the following:

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

接下来,确保启用了重写模块:

Next, make sure that rewrite module is enabled:

a2enmod rewrite

最后,确保 apache 配置为允许 .htaccess 覆盖:

And finally, make sure that apache is configured to allow .htaccess overriding:

AllowOverride All

有关 AllowOverride 指令的更多信息,请参见此处:http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

See here for more information about AllowOverride directive: http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

这篇关于在此服务器上找不到请求的 URL/frontend/ru/site/login/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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