0

我不知道问这类问题是否正确。我有一个域名http://www.mycorporateservices.com/并且有一个页面的 URL 为http://www.mycorporateservices .com/Corporate-Services。我想编辑这个 URL 的内容。但是当我通过 ftp 客户端浏览时,我找不到任何名称为 Corporate-Services 的文件夹。所有页面都是用 PHP 制作的。谢谢任何帮助。

   <?php
// Version
define('VERSION', '1.5.2.1');

// Configuration
require_once('config.php');

// Install 
if (!defined('DIR_APPLICATION')) {
    header('Location: ../install/index.php');
    exit;
}

//VirtualQMOD
require_once('../vqmod/vqmod.php');
$vqmod = new VQMod();

// VQMODDED Startup
require_once($vqmod->modCheck(DIR_SYSTEM . 'startup.php'));

// Application Classes
require_once($vqmod->modCheck(DIR_SYSTEM . 'library/currency.php'));
require_once($vqmod->modCheck(DIR_SYSTEM . 'library/user.php'));
require_once($vqmod->modCheck(DIR_SYSTEM . 'library/weight.php'));
require_once($vqmod->modCheck(DIR_SYSTEM . 'library/length.php'));

// Registry
$registry = new Registry();

// Loader
$loader = new Loader($registry);
$registry->set('load', $loader);

// Config
$config = new Config();
$registry->set('config', $config);

// Database
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$registry->set('db', $db);

// Settings
$query = $db->query("SELECT * FROM " . DB_PREFIX . "setting WHERE store_id = '0'");

foreach ($query->rows as $setting) {
    if (!$setting['serialized']) {
        $config->set($setting['key'], $setting['value']);
    } else {
        $config->set($setting['key'], unserialize($setting['value']));
    }
}

// Url
$url = new Url(HTTP_SERVER, $config->get('config_use_ssl') ? HTTPS_SERVER : HTTP_SERVER);   
$registry->set('url', $url);

// Log 
$log = new Log($config->get('config_error_filename'));
$registry->set('log', $log);

function error_handler($errno, $errstr, $errfile, $errline) {
    global $log, $config;

    switch ($errno) {
        case E_NOTICE:
        case E_USER_NOTICE:
            $error = 'Notice';
            break;
        case E_WARNING:
        case E_USER_WARNING:
            $error = 'Warning';
            break;
        case E_ERROR:
        case E_USER_ERROR:
            $error = 'Fatal Error';
            break;
        default:
            $error = 'Unknown';
            break;
    }

    if ($config->get('config_error_display')) {
        echo '<b>' . $error . '</b>: ' . $errstr . ' in <b>' . $errfile . '</b> on line <b>' . $errline . '</b>';
    }

    if ($config->get('config_error_log')) {
        $log->write('PHP ' . $error . ':  ' . $errstr . ' in ' . $errfile . ' on line ' . $errline);
    }

    return true;
}

// Error Handler
set_error_handler('error_handler');

// Request
$request = new Request();
$registry->set('request', $request);

// Response
$response = new Response();
$response->addHeader('Content-Type: text/html; charset=utf-8');
$registry->set('response', $response); 

// Cache
$cache = new Cache();
$registry->set('cache', $cache); 

// Session
$session = new Session();
$registry->set('session', $session); 

// Language
$languages = array();

$query = $db->query("SELECT * FROM " . DB_PREFIX . "language"); 

foreach ($query->rows as $result) {
    $languages[$result['code']] = $result;
}

$config->set('config_language_id', $languages[$config->get('config_admin_language')]['language_id']);

// Language 
$language = new Language($languages[$config->get('config_admin_language')]['directory']);
$language->load($languages[$config->get('config_admin_language')]['filename']); 
$registry->set('language', $language);      

// Document
$registry->set('document', new Document());         

// Currency
$registry->set('currency', new Currency($registry));        

// Weight
$registry->set('weight', new Weight($registry));

// Length
$registry->set('length', new Length($registry));

// User
$registry->set('user', new User($registry));

// Front Controller
$controller = new Front($registry);

// Login
$controller->addPreAction(new Action('common/home/login'));

// Permission
$controller->addPreAction(new Action('common/home/permission'));

// Router
if (isset($request->get['route'])) {
    $action = new Action($request->get['route']);
} else {
    $action = new Action('common/home');
}

// Dispatch
$controller->dispatch($action, new Action('error/not_found'));

// Output
$response->output();
?>
4

2 回答 2

0

这里显然.htaccess正在进行重写,因此“公司服务”正在被重写为其他内容。很可能是一个 PHP 页面。

如果您可以看到一个名为 的文件.htaccess,那么我建议您阅读此文件以查看正在重写的地址。如果您不理解该.htaccess文件,则只需搜索企业服务并将代码粘贴到您的问题中。

有关.htaccess重写的更多信息,请查看:

http://roshanbh.com.np/2008/03/url-rewriting-examples-htaccess.html

更新

是的,您.htaccess正在将地址改写为: http://www.mycorporateservices.com/index.php?路线=企业服务

因此,如果您想编辑此文件,您需要打开“index.php”并找到一个测试条件,例如:

if($_GET['_route_']=='Corporate-Services'){
    // Content Here
}
于 2012-08-23T11:36:41.257 回答
0

通常 URL 不会模仿文件系统结构 [而且它们不模仿很好]。

实际上,您可能会调用以下内容:

http://www.mycorporateservices.com/index.php/Corporate-Services

然后服务器知道如何处理Corporate-Services参数 - url 只是由.htaccess脚本重写。

弄清楚安装的框架是如何工作的,但Corporate-Services/index.php当然没有办法编辑文件。

于 2012-08-23T11:38:53.190 回答