Nginx下Magento伪静态规则,适用于LNMP一键包
文件名为:magento.conf(下载),将其放在 /usr/local/nginx/conf/ 文件夹下
然后在 /usr/local/nginx/conf/vhost/www.yourname.com.conf 中将include none.conf; 换成include magento.conf;即可。" B3 M( l8 {! g e7 N
( ~) ^+ j [1 M+ ~) b' K+ \
- location / {
- index index.html index.php; ## Allow a static html file to be shown first
- try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
- expires 30d; ## Assume all files are cachable
- }
- ## These locations would be hidden by .htaccess normally
- location /app/ { deny all; }
- location /includes/ { deny all; }
- location /lib/ { deny all; }
- location /media/downloadable/ { deny all; }
- location /pkginfo/ { deny all; }
- location /report/config.xml { deny all; }
- location /var/ { deny all; }
- location /var/export/ { ## Allow admins only to view export folder
- auth_basic "Restricted"; ## Message shown in login window
- auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
- autoindex on;
- }
- location /. { ## Disable .htaccess and other hidden files
- return 404;
- }
- location @handler { ## Magento uses a common front handler
- rewrite / /index.php;
- }
- location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
- rewrite ^(.*.php)/ $1 last;
- }
最后是重启nginx: k! {' D2 |9 a4 r4 `& \
( \3 u" T2 J/ s' B; l
/etc/init.d/nginx restart
/usr/local/nginx/sbin/nginx -s reload
Nginx下Magento伪静态规则,适用于LNMP一键包的更多相关文章
- Nginx下wordpress伪静态规则(rewrite)
当我们从apache服务器转向Nginx服务器的时候,它们的伪静态规则就不一样了,所以你熟悉Nginx服务器的伪静态规则,自己写当然也好.但很多网友还是不太了解Nginx服务器的伪静态规则的,而如果你 ...
- CentOS下Web服务器环境搭建LNMP一键安装包
CentOS下Web服务器环境搭建LNMP一键安装包 时间:2014-09-04 00:50来源:osyunwei.com 作者:osyunwei.com 举报 点击:3797次 最新版本:lnmp- ...
- 给lnmp一键包中的nginx安装openresty的lua扩展
lnmp一键包(https://lnmp.org)本人在使用之后发现确实好用,能帮助我们快速搭建起lnmp.lamp和lnmpa的web生产环境,因此推荐大家可以多试试.但有的朋友可能需要使用open ...
- shopnc B2B2C商城 Nginx下开启伪静态
B2B2C商城 Nginx下开启伪静态,伪静态开启后,对系统的SEO极为有利,可以最大限度让商城页面被搜索引擎抓取,但在实际安装中,很多客户在这块都会遇到各种各样的问题. 1. 编辑商城配置文件(da ...
- 解决NGINX的WORDPRESS伪静态规则失效的问题
解决NGINX的WORDPRESS伪静态规则失效的问题 前两天搬到了EMSVPS的PR线路上,用上了最新的WDCP2.0管理面板,支持多用户管理(我们几个合租的VPS,最需要这个功能了),感觉很不错, ...
- Linux下Web服务器环境搭建LNMP一键安装包[20130911更新]
2012年08月14日 ⁄ LNMP ⁄ 评论数 73 ⁄ 被围观 25,200次+ 最新版本:lnmp-2.4 安装说明:请保证服务器能够正常上网.服务器系统时间准确.yum命令可以正常使用! 1. ...
- 实例讲解Nginx下的rewrite规则(转)
一.正则表达式匹配,其中:* ~ 为区分大小写匹配* ~* 为不区分大小写匹配* !~和!~*分别为区分大小写不匹配及不区分大小写不匹配二.文件及目录匹配,其中:* -f和!-f用来判断是否存在文件* ...
- 实例讲解Nginx下的rewrite规则 来源:Linux社区
一.正则表达式匹配,其中:* ~ 为区分大小写匹配* ~* 为不区分大小写匹配* !~和!~*分别为区分大小写不匹配及不区分大小写不匹配二.文件及目录匹配,其中:* -f和!-f用来判断是否存在文件* ...
- 实例讲解Nginx下的rewrite规则
一.正则表达式匹配,其中:* ~ 为区分大小写匹配* ~* 为不区分大小写匹配* !~和!~*分别为区分大小写不匹配及不区分大小写不匹配二.文件及目录匹配,其中:* -f和!-f用来判断是否存在文件* ...
随机推荐
- Python连接Oracle
http://wenku.baidu.com/link?url=2yVoHbJ3XTnZdbyOkN923ncGPqXygJiB6wSRBkqlqimR6H8XxWpBT6GxCTFgmALyqGH0 ...
- Spring MVC Rest 支持CORS
新建cors filter文件, package cn.ac.iscas.pebble.ufe.tools; import java.io.IOException; import javax.serv ...
- Android Acitivity 生命周期
Activity的生命周期: (1)启动Activity:系统会先调用onCreate方法,然后调用onStart方法,最后调用onResume,Activity进入运行状态. (2)当前Activi ...
- topcoder SRM 618 DIV2 LongWordsDiv2
此题给出的条件是: (1)word的每个字母都是大写字母(此条件可以忽略,题目给的输入都是大写字母) (2) 相等字符不能连续,即不能出现AABC的连续相同的情况 (3)word中不存在字母组成xyx ...
- Codeforces Round #252 (Div. 2) A - Valera and Antique Items
水题 #include <iostream> #include <set> #include <vector> #include <algorithm> ...
- ACM: FZU 2150 Fire Game - DFS+BFS+枝剪 或者 纯BFS+枝剪
FZU 2150 Fire Game Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u ...
- 3801. String LD
Description Stringld (left delete) is a function that gets a string and deletes its leftmost charact ...
- ffmpeg解码
解码流程 http://www.cnblogs.com/lidabo/p/4582391.html 例子 http://www.cnblogs.com/lidabo/p/4582393.html
- solrcloud线上创建collection,修改默认配置
一.先看API,创建collection 1.上传配置文件到zookeeper 1) 本地内嵌zookeeper集群:java -classpath ./solr-webapp/webapp/WEB- ...
- [CareerCup] 17.6 Sort Array 排列数组
17.6 Given an array of integers, write a method to find indices m and n such that if you sorted elem ...