CMS Made Simple/可选设置
|
CMS Made Simple | 安装 | 内容管理 | 布局 | 用户&用户组 | 站点管理 | 我的设置 | 扩展 | FAQ |
一些设置参数都被设置成默认值,并且在网页页面时更改不了的。尽管CMS Made Simple是安装即用的,但是你可能还是想修改这些参数值。
提示:如果在config.php文件中修改了任何东西,请记得在修改后刷新一下缓存;
用编辑器打开config.php文件(这一文件是在安装程序或者你自己在安装过程中创建的)
友好URLs和mod_rewrite[ ]
1.6.x版本:
修改你的config.php文件:
$config['url_rewriting'] = 'mod_rewrite'; // this is new from 1.6 $config['page_extension'] = '.html'; $config['use_hierarchy'] = true; // no longer in the config file $config['query_var'] = 'page';
然后,在提供的sample/doc/htaccess.txt中创建.htaccess重写规则;
完成后,不要忘记将你的config.php文件的操作权限改为444或者更低;
如果设置没有效果:
请尝试监视这一进程(创建rewritelog,提高http错误等级...);
在CMS MS外部进行一些(静态的...)重写测试;
去官方论坛提问;
1.6之前版本:
CMS Made Simple 有两种方法实现对搜索引擎优化友好的URLs,一个是它的内部机制,另一个是mod_rewrite;
提示:你只能使用一种方法,不可两个方法同时使用;
内部机制实现的URLs:
http://www.example.com/index.php/parent/child
mod_rewrite实现的URLs:
http://www.example.com/parent/child
内部机制整个处理过程使用的都是PHP,并不需要Apache服务器的mod_rewrite服务;但是,在IIS中却实现不了,如果你想实现的话,必须确保你的模板文件包含了{metadata}标签,然后在config.php文件中进行如下设置:
$config['internal_pretty_urls'] = true;
如果你想使用mod_rewrite这种方法实现友好URLs的话,请将上面的设置值“true”改为“false”,然后添加如下设置:
$config['assume_mod_rewrite'] = true;
注解[ ]
上面的一些设置指导都是针对与CMS MS的老的版本,现在你只需要在一个行代码中更改这些设置,下面是默认值的设置,你可以更改成“internal”或者是“mod_rewrite”:
$config['url_rewriting'] = 'none';
如果你设置的是mod_rewrite值,你还需要一个包含重写规则的.htaccess文件,你可以将/doc/htaccess.txt文件里的内容复制到根目录下的/.htaccess文件中,注意你的Apache服务器的设置需要有“AllowOverride All”这一指令,另外,你还需要确保你的FTP客户端设置成ASCII编码来传输这一文件;
与mod_rewrite一起使用的其他进一步设置:
$config['page_extension'] = ;
任何你设置的值,都会自动附加到URLs的末端,但并不影响URLs的产生过程;通过这一设置,可以使得页面看起来想一个静态网页,利于搜索引擎搜索,例如,你可以设置成“.html”,然后最终的URL将会显示成这样:
http://www.example.com/parent/child.html
你也可以在页面的URLs中反映它们所在的位置、层次,只需要将“use_hierarchy”选项进行如下设置:
$config['use_hierarchy'] = true;
如果这一选项设置成false的话,那么下面第一url将会改为显示成第二个:
http://www.example.com/parent/child http://www.example.com/child
通过.htaccess进行URL过滤[ ]
通过在你的.htaccess文件中添加几行规则,你就可以增强你的站点的安全性并且可以阻止一些黑客意图;这些规则拒绝这些http请求,包括漏洞中常用的一些字符,但是并不影响CMS MS的正常操作;
这些都需要Apache服务器,以及对.htaccess文件的支持,所以纵使你不使用CMS MS的友好URLs功能,你还是需要开启服务器上的mod_rewrite服务;
下面是同时使用URL过滤和友好URL的.htaccess文件中的相关设置:
# BEGIN Optional settings
# Turns off directory browsing
# not absolutely essential, but keeps people from snooping around without
# needing empty index.html files everywhere
Options -Indexes
# Deny access to config.php
# This can be useful if php ever breaks or dies
# Use with caution, this may break other functions of CMSms that use a config.php
# file. This may also break other programs you have running under your CMSms
# install that use config.php. You may need to add another .htaccess file to those
# directories to specifically allow config.php.
<Files "config.php">
order allow,deny
deny from all
</Files>
# Sets your 403 error document
# not absolutely essential to have,
# or you may already have error pages defined elsewhere
ErrorDocument 403 /forbidden403.shtml
# No sense advertising what we are running
ServerSignature Off
# END Optional Settings
# BEGIN CMSMS and Rewrite Rules
# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On
# Might be needed in a subdirectory
#RewriteBase /
# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<script>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^.*$ - [F,L]
# END Filtering
# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# END CMSMS
# END Rewrite rules
图像处理库[ ]
CMS MS的图片管理器可以使用的图像处理库有:GD、NetPBM、ImageMagick;
$config["image_manipulation_prog"] = "GD";
如果使用的NetPBM或者是ImageMagick,你还需要进行如下具体设置:
$config["image_transform_lib_path"] = "/usr/bin/ImageMagick/";
文件管理器的上传路径[ ]
$config["uploads_path"] = "/site/web/cms/uploads"; $config["uploads_url"] = "http://www.cmsmadesimple.org/cms/uploads";
图片管理器的上传路径[ ]
$config["image_uploads_path"] = "/site/web/cms/uploads/images"; $config["image_uploads_url"] = "http://www.cmsmadesimple.org/cms/uploads/images";
WYSIWYG编辑器的HTML有效[ ]
CMS MS为WYSIWYG编辑器提供了一个实时的HTML代码审核的插件,却保产生一个有效的HTML内容,但是这一功能默认是关闭的,禁止使用表格以及一些标记标签;
修正:在安装过程中产生的config.php文件中你将会看到该功能默认是开启的,但是不在使用,之所以还保留,是为了以防万一:
$config["use_Indite"] = false;
参考来源[ ]
CMS Made Simple使用手册导航 | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
针对所有用户:
|