wamp本地环境为静态与lnmp集成环境下nginx为zencart的静态配置
来源:互联网 发布:ie优化公司 编辑:程序博客网 时间:2024/05/22 12:53
wamp本地环境为静态配置篇:
第一步:找到Apache安装目录下httpd.conf这个文件,搜索找到,“LoadModulerewrite_module modules/mod_rewrite.so”,找到这一行,去掉前面的“#”;
第二步:找到
AllowOverride None
”改为
AllowOverride All.第三步:重启apache
第四步:新建.haccess文件,放在当前网站根目录下,在.haccess文件中写伪静态规则,看示例
RewriteEngine on
RewriteBase /
RewriteRule ^article\.html$ /article.php
RewriteRule ^article\_(+)\.html$/article.php?page=$1
到此就完成了。
nginx服务器为静态配置:
LNMP默认添加了Discuz、Wordpress、Sablog、emlog、dabr等伪静态支持,在新建虚拟主机时,输入以上名称就能 对上述程序伪静态完美支持。
如果,您还需要添加自定义伪静态规则,直接输入一个你想要的伪静态规则的名称,然后编辑/usr/local/nginx /conf/你自定义的伪静态名字.conf 里面添加伪静态规则。
在这里记录下我本人以前添加的一个关于zencart的记录:
在安装lnmp环境的时候写的一个为静态文件名称是叫other.conf;
所以就要在/usr/local/nginx/conf/下添加other,conf这个为静态规则文件;
内容如下:
location / {if (!-e $request_filename){#————————zen-cart start——————# From Ultimate SEO URLsrewrite "^(.*)-p-(.*).html" /index.php?main_page=product_info&products_id=$2&% last;rewrite "^(.*)-c-(.*).html" /index.php?main_page=index&cPath=$2&% last;rewrite "^(.*)-m-([0-9]+).html" /index.php?main_page=index&manufacturers_id=$2&% last;rewrite "^(.*)-pi-([0-9]+).html" /index.php?main_page=popup_image&pID=$2&% last;rewrite "^(.*)-pr-([0-9]+).html" /index.php?main_page=product_reviews&products_id=$2&% last;rewrite "^(.*)-pri-([0-9]+).html" /index.php?main_page=product_reviews_info&products_id=$2&% last;# For Open Operations Info Managerrewrite "^(.*)-i-([0-9]+).html" /index.php?main_page=info_manager&pages_id=$2&% last;# For dreamscape’s News & Articles Managerrewrite "^news/?" /index.php?main_page=news&% last;rewrite "^news/rss.xml" /index.php?main_page=news_rss&% last;rewrite "^news/archive/?" /index.php?main_page=news_archive&% last;rewrite "^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html" /index.php?main_page=news&date=$1-$2-$3&% last;rewrite "^news/archive/([0-9]{4})-([0-9]{2}).html" /index.php?main_page=news_archive&date=$1-$2&% last;rewrite "^news/(.*)-a-([0-9]+)-comments.html" /index.php?main_page=news_comments&article_id=$2&% last;rewrite "^news/(.*)-a-([0-9]+).html" /index.php?main_page=news_article&article_id=$2&% last;# All other pages# Don’t rewrite real files or directories#RewriteCond %{REQUEST_FILENAME} !-f [NC]#RewriteCond %{REQUEST_FILENAME} !-drewrite "^(.*).html" /index.php?main_page=$1&% last;#—————————-zen-cart end—————–}}
差不多就是这些了。
有疑问欢迎大家交流,更欢迎高手拍砖。
- wamp本地环境为静态与lnmp集成环境下nginx为zencart的静态配置
- zencart开启本地环境静态页
- 利用Apache配置本地域名(wamp 集成环境下 )
- 【Nginx】LNMP环境下的后续配置
- wamp集成环境下配置虚拟域名
- [Nginx] Wordpress在Nginx环境下配置伪静态
- 在wamp集成开发环境下discuz论坛开启伪静态
- wamp集成环境开启rewrite伪静态支持
- wamp集成环境开启rewrite伪静态支持
- wamp集成环境开启rewrite伪静态支持
- 【centos】LNMP集成环境 的 安装 与 配置
- 配置Lnmp环境中的Nginx与Php
- wamp集成环境虚拟主机的配置
- wamp或phpStudy集成环境配置本地域名
- Wamp与LNMP环境下的mysql进入后查看数据库时报错的不同解决方法
- LNMP环境下的nginx重写
- 10分钟搭建 nginx +php +mysql(LNMP)此为线上环境配置专用
- 从零搭建LNMP环境(二) - 集成Nginx与PHP
- ASP.NET MVC自定义Html辅助方法
- uva 10115 - Automatic Editing
- hdu题目分类
- 第3.2.5节 android部件
- 如何在iOS中使用Block
- wamp本地环境为静态与lnmp集成环境下nginx为zencart的静态配置
- 第四节,利用别名实现函数返回多个值
- F#与C#比较
- 经典算法链接
- arm 汇编
- JS中setTimeout和setInterval用法简介
- android NDK开发环境搭建
- nyoj-102-次方求模
- HibernateTemplate 的 两个 execute 方法区别