2011-11-10 88 views
0

我的第一天用ExpressionEngine,我知道基本的CodeIgniter。ExpressionEngine 2,管理路径路由

  1. ./admin.php更名为./john_doe.php
  2. 更新$配置[ 'cp_url']http://mysite.com/john_doe.php

我想重定向 mysite.com/ johndoe mysite.com/ john_doe.php,只是为了管理EE2的替代方案。

在笨(可根据用户指南)这行必须加入到./application/config/routes.php文件:

$route['johndoe'] = "john_doe.php"; 

问题是:我怎样才能做到这一点在ExpressionEngine?

在此先感谢。

+1

这根本不会帮助你解决问题,但是当我不得不处理EE时,我发现严重的代码点火器知识并没有帮助我。也可能被遗忘,它与CI有任何关系。 –

回答

0

如果您只想将/johndoe重定向到/john_doe.php,则无需对ExpressionEngine执行任何操作(除非您确实需要)。

相反,只是创建了Apache的.htaccess文件的简单mod_rewrite规则:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteRule ^johndoe /john_doe.php [R=301,L] 
</IfModule> 

它曾经是很难在EE1 mask access to the Control Panel,但EE 2.2的它很简单—简单的包含文件admin.php重命名为任何你想。

然后使用该文件名在你的URL来访问控制面板,而不是[更名]的系统文件夹:

http://example.com/Xtr3m-H4x0r.php 

ExpressionEngine将改写所有的控制面板链接的使用蒙面访问文件名 - - 不过不要忘记编辑文件,以确保路径到您的系统文件夹设置正确:

$system_path = './renamed-system-folder'; 
+0

虽然.htaccess文件解决方案失败,但我更喜欢重命名文件解决方案,并为CP文件提供了一个复杂的名称和正确的路径。 – quantme

+0

我只是通过删除URI上的开始斜杠来修复'.htaccess'规则;完全监督我的部分。它应该现在正确工作。 – rjb

1

的“老派” —点菜EE1 —方式来马对EE2中控制面板的sk访问仍然是可能的。

打开了/system/index.php并取消define('MASKED_CP', TRUE);

/* 
* -------------------------------------------------------------------- 
* MASKED CP ACCESS 
* -------------------------------------------------------------------- 
* 
* This lets the system know whether or not the control panel is being 
* accessed from a location outside the system folder 
* 
* NOTE: If you set this, be sure that you set the $system_path and the 
* 'cp_url' item in the $assign_to_config array below! 
* 
*/ 

define('MASKED_CP', TRUE); 

在同一文件中,取消和以下两个变量设置为您的新环境:

$system_path = "./masked-system"; 

$assign_to_config['cp_url'] = 'http://example.com/masked-system/index.php'; 

这是另一种方式面具访问控制面板

在ExpressionEngine用户指南中,重命名admin.php的技术要容易得多,建议作为Post-Installation Best Practice

+0

很多尝试,并没有按预期工作,但是是我想解决它的一个有趣的解决方案。 – quantme