在DEDEAMPZ环境中使用帝国ECMS的伪静态功能

今天测试帝国ECMS的伪静态化功能,使用的AMP组件式DEDEAMPZ,发现没有开启伪静态功能。在Apache程序目录下的conf目录,找到httpd.conf,LoadModule rewrite_module modules/mod_rewrite.so已经默认加载。所以如果在Apache配置帝国的伪静态规则,应该是可以伪静态化的。但现在我要用.htaccess文件来实现伪静态化。

在httpd.conf中找到

<Directory /> 
Options Indexes 
AllowOverride None 
Order allow,deny 
Allow from all 
</Directory>

修改为:

<Directory /> 
Options Indexes FollowSymLinks 
AllowOverride all 
Order allow,deny 
Allow from all 
</Directory>

测试!成功了!成功了,You Did IT!Yeah!

注意红色部分,否则开启伪静态后,帝国ECMS将提示没有权限访问,连后台也访问不了。

附帝国ECMS v7的伪静态规则,可直接贴到.htaccess中。

# BEGIN ECMS

RewriteEngine On

#信息内容页:showinfo-[!--classid--]-[!--id--]-[!--page--].html

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^showinfo-(.+?)-(.+?)-(.+?)\.html$ /e/action/ShowInfo.php?classid=$1&id=$2&page=$3

#信息列表:listinfo-[!--classid--]-[!--page--].html

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^listinfo-(.+?)-(.+?)\.html$ /e/action/ListInfo/index.php?classid=$1&page=$2

 

#标题分类列表页:infotype-[!--ttid--]-[!--page--].html

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^infotype-(.+?)-(.+?)\.html$ /e/action/InfoType/index.php?ttid=$1&page=$2

 

#TAGS信息列表页:tags-[!--tagname--]-[!--page--].html

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^tags-(.+?)-(.+?)\.html$ /e/tags/index.php?tagname=$1&page=$2

# END ECMS

暂无评论

发表评论

您的电子邮件地址不会被公开,必填项已用*标注。

相关推荐

使用帝国ecms自带数据备份恢复功能迁移网站

用帝国ecms自带备份数据,恢复数据功能迁移帝国cms时,发现栏目没有创建?实际上有创建,只不过要做一些刷新的工作。 先到后台数据更新中心“删除栏目缓存文件”,否则左边栏目管理菜单都不会出来,提示新建栏目; 然到栏目管理页面,选中所有栏目,然后点“刷新栏目页面”就好了。