Ecshop:ecshop nginx下实现url静态化
1、在nginx/conf/tuwen.com.conf中添加:
include ecshop.conf;
2、编辑nginx/ecshop.conf:
location / {
rewrite "^/index\.html" /index.php last;
rewrite "^/category$" /index.php last;
rewrite "^/feed-c([0-9]+)\.xml$" /feed.php?cat=$1 last;
rewrite "^/feed-b([0-9]+)\.xml$" /feed.php?brand=$1 last;
rewrite "^/feed\.xml$" /feed.php last;
rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last;
rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last;
rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last;
rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3 last;
rewrite "^/category-([0-9]+)-b([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2 last;
rewrite "^/category-([0-9]+)(.*)\.html$" /category.php?id=$1 last;
rewrite "^/goods-([0-9]+)(.*)\.html" /goods.php?id=$1 last;
rewrite "^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last;
rewrite "^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$" /article_cat.php?id=$1&page=$2 last;
rewrite "^/article_cat-([0-9]+)(.*)\.html$" /article_cat.php?id=$1 last;
rewrite "^/article-([0-9]+)(.*)\.html$" /article.php?id=$1 last;
rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html" /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last;
rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2&page=$3 last;
rewrite "^/brand-([0-9]+)-c([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2 last;
rewrite "^/brand-([0-9]+)(.*)\.html" /brand.php?id=$1 last;
rewrite "^/tag-(.*)\.html" /search.php?keywords=$1 last;
rewrite "^/snatch-([0-9]+)\.html$" /snatch.php?id=$1 last;
rewrite "^/group_buy-([0-9]+)\.html$" /group_buy.php?act=view&id=$1 last;
rewrite "^/auction-([0-9]+)\.html$" /auction.php?act=view&id=$1 last;
rewrite "^/exchange-id([0-9]+)(.*)\.html$" /exchange.php?id=$1&act=view last;
rewrite "^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last;
rewrite "^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last;
rewrite "^/exchange-([0-9]+)-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2 last;
rewrite "^/exchange-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1 last;
}
3、重启nginx:
/usr/local/nginx/sbin/nginx -s reload
Ecshop:ecshop nginx下实现url静态化的更多相关文章
- PHP 404页面/如何设置404页面/URL静态化/URL伪静态化
php中如何设置404页面及其他错误页面 首先在项目根目录下新建文件,文件名为" .htaccess " 在该文件中写入一下配置项: ErrorDocument 404 /404. ...
- 如何做URL静态化 和页面的静态化
为什么要进行URL静态化? 如果帮到了您,您可以小支持一下,谢谢您 1.更好的迎合搜索引擎工作原理的爬行抓取机制:2.把网站URL静态化更有助于网站获得好的排名:3.URL静态化有利于用户体验.不 ...
- ecshop在nginx下实现负载均衡
ecshop在负载方面的功能是十分弱小的.当你的IP每个小时到达了一万IP.如果在带宽和服务器硬件有限的情况下.你的服务器很快就会崩溃的.网站直接挂掉.为了增强ecshop在负载均衡方面的能力.我们可 ...
- Apache 和 Nginx 下的 URL 重写
URL 重写和重定向 URL 重写是将页面映射到本站另一页面, 而重定向则是将页面映射到另一主机(域名). 其中临时重定向(R=302)和永久重定向(R=301)都是亲搜索引擎的, 是 SEO 的重要 ...
- winserver 2008 r2 iis7.5 实现php wordpress url静态化操作步骤(UrlRewrite实现)
参考网址:http://jingyan.baidu.com/article/cbf0e500ebec582eaa2893d2.html 文中涉及到的程序源码以及配置 详见附件:http://files ...
- Discuz论坛URL静态化规则urlrewrite
http://blog.csdn.net/u014181418/article/details/53467980 1.在论坛代码目录下新建文件".htaccess" vim /us ...
- [转]nginx下的url rewrite
转:http://zhengdl126.iteye.com/blog/698206 if (!-e $request_filename){rewrite "^/index\.html&quo ...
- 20、wordpress博客url静态化
20.1 wordpress没有实现伪静态时的网页: 20.2进入wordpress后台: 1.设置 2.固定链接 3.自定义链接 /archives/%post_id%.html #%post_id ...
- JSP页面静态化总结之一使用URLRewrite实现url地址伪静态化
JSP页面静态化总结之一使用URLRewrite实现url地址伪静态化 1使用URLRewrite实现url地址伪静态化1.1URLRewirte的用处 1.满足搜索引擎的要求. 2.隐藏技术实现,提 ...
随机推荐
- Lagom学习 五 Hello world工程
用Maven创建一个Hello world的Lagom工程: 1: 在想创建工程的目下下,打开CMD 2: mvn archetype:generate -Dfilter=com.lightbend ...
- IOS推流 搭建环境
效果图 iTools有点卡, 但是推到服务器倒是很快的. 推流 前言 这篇blog是iOS视频直播初窥:<喵播APP>的一个补充. 因为之前传到github上的项目中没有集成视频的推流.有 ...
- Hibernate 的HQL和sql有什么区别
转自:https://blog.csdn.net/haozhugogo/article/details/54575802sql 面向数据库表查询 hql 面向对象查询 hql : from 后面跟的 ...
- Linux命令总结_touch创建文件
1.touch命令,用来创建文件或者修改文件时间戳 格式:touch [选项]... 文件... 选项 : -a 或--time=atime或--time=access或--time=use 只 ...
- 鼠标右键添加cmd
给鼠标右键添加 cmd https://jingyan.baidu.com/article/3f16e003c408142591c103b2.html 有一些软件,最好不要装到Program File ...
- 多进程小例子--fork+pipe
1 #include<stdio.h> 2 #include<unistd.h> 3 4 #define m 6 5 int main() 6 { 7 ...
- SetROP2
一个Windows API SetROP2(int nDrawMode)的使用 该函数的主要的作用是根据nDrawMode设置的方式重新设定绘图的方式,下面就不同的nDrawMode值具体解释绘图模式 ...
- SharePoint 2010 搜索结果没有显示部分文件
Why SharePoint 2010 search does not show some results? SharePoint 2010 search is better than ever ...
- 宽度设置百分比 高度跟宽度一样css解决方案
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Solr 6.7学习笔记(07)-- More Like This
Solr中提供了MoreLikeThis的功能,用于查询相似的文档 .应用场景(个人理解):1. 你写的文章和别人文章相似度高的话,有一方是抄袭的可能性就很大.2. 查找相似的产品. MoreLike ...