phpstudy 安装选择,iis+php组合,如何设置伪静态

如题。

找了半天,终于找到解决方案了。

需要在服务器上安装 Url rewrite 组件。

服务器是64位则安装: rewrite_2.0_rtw_x64.exe

 然后添加 web.config配置文件,放到站点的根目录。

文件内容如下:

"1.0" encoding="UTF-8"?>

    
        
            
                
                "index.php" />
           "portal.php" />
                "Default.htm" />
                "index.htm" />
                "Default.asp" />
                "index.html" />
                "iisstart.htm" />
                "default.aspx" />
            
        

    
        "portal_topic">
            "^(.*/)*topic-(.+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
        
        "portal_article">
            "^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" />
        
        "forum_forumdisplay">
            "^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
        
        "forum_viewthread">
            "^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/forum.php\?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" />
        
        "group_group">
            "^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" />
        
        "home_space">
            "^(.*/)*space-(username|uid)-(.+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" />
        
        "home_blog">
            "^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/home.php\?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}" />
        
        "forum_archiver">
            "^(.*/)*(fid|tid)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/index.php\?action={R:2}&value={R:3}&{R:4}" />
        
        "plugin">
            "^(.*/)*([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/plugin.php\?id={R:2}:{R:3}&{R:4}" />
        

"help_list">
            "^(.*/)*list-(\w+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/plugin.php\?id=wq_help&cid={R:2}&{R:3}" />
        
        "article_list">
            "^(.*/)*articlelist-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/plugin.php\?id=wq_wechatcollecting&mod=list&classid={R:2}&displayorder={R:3}&page={R:4}&{R:5}" />
        
        "article_view">
            "^(.*/)*wechatarticle-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/plugin.php\?id=wq_wechatcollecting&mod=view&articleid={R:2}&{R:3}" />
        
        "wechat_list">
            "^(.*/)*wechatlist-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/plugin.php\?id=wq_wechatshow&mod=list&classid={R:2}&displayorder={R:3}&page={R:4}&{R:5}" />
        
        "wechat_view">
            "^(.*/)*wechat-(\w+)-([0-9]+).html\?*(.*)$" />
            "Rewrite" url="{R:1}/plugin.php\?id=wq_wechatshow&mod=view&wid={R:2}&page={R:3}&{R:4}" />
        

    

    
View Code

我用的是discuz的一套伪静态规则。

你可能感兴趣的:(phpstudy 安装选择,iis+php组合,如何设置伪静态)