页面不存在错误


Page doesn't exist error

我正在尝试安装一个名为 JobberBase 的脚本,但没有成功...问题是我的主页加载正常,但是当我单击任何链接时,它只是说该页面不存在......这是一个活生生的例子:http://onboardcloud.com这是我的配置文件:

<?php
/**
 * Define environments
 *
 */
// local
$__instances['local'] = array(
    // The prefix should be a unique part of the url (not including protocol name or auth info; see below).
    'prefix' => 'localhost',
    // mysql credentials
    'db_host' => 'localhost',
    'db_port' => 3306,
    'db_user' => 'root',
    'db_password' => 'password',
    'db_name' => 'jobberbase',
    'db_prefix' => '',
    // your site's full url
    'app_url' => 'http://localhost/',
    // language to use
    'lang_code' => 'en',
    // error reporting
    'ini_error_reporting' => E_ALL,
    'ini_display_errors' => 'On',
    // environment setting 1 (use 'local' for localhost/testing OR 'online' for live, production environment)
    'location' => 'online',
    // environment setting 2 (use 'dev' together with 'local' in the previous setting OR 'prod' with 'online')
    'environment' => 'prod',
    //'apache_mod_rewrite', 'iis_url_rewrite' -microsoft URL Rewrite module, 'iis_isapi_rewrite'
    'rewrite_mode' => 'apache_mod_rewrite'
);
// live
$__instances['live'] = array(
    'prefix' => 'onboardcloud.com',
    'db_host' => 'localhost',
    'db_port' => 3306,
    'db_user' => 'root',
    'db_password' => 'password',
    'db_name' => 'jobberbase',
    'db_prefix' => '',
    'app_url' => 'http://onboardcloud.com/',
    // language to use
    'lang_code' => 'en',
    'ini_error_reporting' => E_ALL,
    'ini_display_errors' => 'Off',
    'location' => 'online',
    'environment' => 'prod',
    'rewrite_mode' => 'apache_mod_rewrite'
);

// http requests
if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI']))
{
    $_compare_to = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
// setup current instance
foreach ($__instances as $__instance)
{
    if (strstr($_compare_to, $__instance['prefix']))
    {
        define('DB_HOST', $__instance['db_host']);
        define('DB_PORT', $__instance['db_port']);
        define('DB_USER', $__instance['db_user']);
        define('DB_PASS', $__instance['db_password']);
        define('DB_NAME', $__instance['db_name']);
        define('DB_PREFIX', $__instance['db_prefix']);
        // values kind of redundant, they indicate wether this is a live/production or dev/testing environment
        define('LOCATION', $__instance['location']);
        define('ENVIRONMENT', $__instance['environment']);
        $app_url = $__instance['app_url'];
        $indexOfLastSlash = strrpos($app_url, "/");
        $expectedIndexOfLastSlash = strlen($app_url) - 1;
        // manually add an ending slash to the app_url if the user didn't specify it
        if ($indexOfLastSlash && $indexOfLastSlash != $expectedIndexOfLastSlash )
            $app_url .= '/';
        // base url of the app
        define('APP_URL', $app_url);
        define('REWRITE_MODE', $__instance['rewrite_mode']);
        // error reporting
        ini_set('error_reporting', $__instance['ini_error_reporting']);
        ini_set('display_errors', $__instance['ini_display_errors']);
        define('LANG_CODE', $__instance['lang_code']);
        break;
    }
}
if(!defined('DB_HOST'))
{
    die('None of the configured JobberBase instances matched your request!<br />If you are an admin of this JobberBase installation, you may want to review the ''prefix'' values of the configured JobberBase instances in config.envs.php.');
}
?>

这是我的.htaccess文件:

ErrorDocument 404 /page-unavailable/
<files ~ "'.tpl$">
order deny,allow
allow from all
deny from none
AllowOverride All
</files>
<Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
 </Directory>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

我正在使用 Ubuntu 作为服务器。我安装了Apache2,PHP,MySQL,suPHP和PHPmyAdmin。任何帮助将不胜感激!

我不知道

jobberbase,但你的htaccess文件应该看起来像这样。

RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
ErrorDocument 404 /page-unavailable/
<Files ~ "'.tpl$">
order deny,allow
deny from all
</Files>

下面这个应该在你的Apache虚拟主机配置文件中。在 Ubuntu 上,它在 /etc/apache2/sites-available/default .如果不是默认的,则无论您在站点可用目录中如何称呼您的网站。如果它已经存在,则无需更改任何内容,只需确保AllowOverride设置为All

<Directory /var/www/>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   allow from all
 </Directory>

然后,如果更新虚拟文件,请确保重新启动 apache。