• 技术文章 >php教程 >php手册

    PHPwind 9升级后 nginx apache iis 伪静态配置

    2016-06-21 08:50:37原创577

    PHPwind 9 正式版是一个非常不错的论坛系统,这里就不多宣传了。主要问题是很多之前的用户升级来发现变化很多,之前的伪静态也不能使用了,这里交给大家一个快速设计PW9的伪静态和PHPwind 8.7升级来后,如何使用继续使用以前的伪静态的方法。

    官方只提供了新版的伪静态的设计方法,如图: 搜索伪静态,按照要求开启即可,

    Apache Web Server 配置

    在www目录下自带了.htaccess文件,开启了rewrite后可直接使用,更改了格式后也无需更改这个文件内容。

    IIS配置

    iis下建议使用isapi_rewrite 第三版,老版本的rewrite不支持RewriteCond语法。 下载地址 http://www.helicontech.com/download-isapi_rewrite3.htm

    	RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule !\.(jsicogifjpe?gbmppngcss)$ index.php [L] 
    
    管理工具-> internet信息服务-> 网站 点右键. -> 属性 ISAPI筛选器 看到下面那个ISAPI_Rewrite3了吧。 转到 rewrite的选项卡 可以看到里面的rewrite规则

    Nginx配置

    location / { 
        if (-f $request_filename) {
               break;
        }
        if ($request_filename ~* "\.(jsicogifjpe?gbmppngcss)$") {
            break;
        }
        if (!-e $request_filename) {
            rewrite . /index.php last;
        }
    } 

    PHPwind 8.7用户升级之后如何使用,请看下面:

    我们这是建立在nginx基础上的配置方法,apache的对照规则修改即可

    #没有开启伪静态,升级pw9后跳转地址 如果不想跳转把 permanent 换成 last
    #rewrite ^/thread-htm-fid-(.+).html$ index.php?m=bbs&c=thread&fid=$1 permanent;
    #rewrite ^/read-htm-tid-(.+).html$ read.php?tid=$1 permanent;

    #开启伪静态,升级pw9后跳转地址 如果不想跳转把 permanent 换成 last
    rewrite ^/thread-htm-fid-(.+).html$ /thread-$1/ permanent;
    rewrite ^/read-htm-tid-(.+).html$ /read-$1/ permanent;



    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    上一篇:一步步编写PHP的Framework(十三) 下一篇:一步步编写PHP的Framework(九)
    千万级数据并发解决方案

    相关文章推荐

    • PHP查询登录中的sql注入• PHP数字字符串左侧补0、字符串填充和自动补齐的几种方法• PHP MySQL开发中的一些经验• CodeIgniter自带的数据库类使用介绍• 鸟哥谈PHP的架构与未来发展
    1/1

    PHP中文网