现在的位置: 首页 > 综合 > 正文

阿里云 服务器 wordpress nginx伪静态设置

2014年09月30日 ⁄ 综合 ⁄ 共 406字 ⁄ 字号 评论关闭
</pre><pre name="code" class="php">
// 找到conf/vhosts下的独立conf文件,比如我的p2p.conf文件,加入以下内容
	location / {
        index index.html index.php;
        if (-f $request_filename/index.html){
            rewrite (.*) $1/index.html break;
        }
        if (-f $request_filename/index.php){
            rewrite (.*) $1/index.php;
        }
        if (!-f $request_filename){
            rewrite (.*) /index.php;
        }
    }

第二部:修改wordpress 固定链接设置,自定义结构

例如:域名/%category%/%post_id%.html ,

第三步:重启nginx服务器

# /alidata/server/nginx/sbin/nginx   -s reload

ok

抱歉!评论已关闭.