RewriteCond

RewriteRule

记录下现在我会的:

RewriteEngine On
#RewriteRule ^(.*)/(.*)/$ index.php?m=index&c=$1&a=$2 [QSA]
#RewriteRule ^(.*)/$ index.php?m=index&c=$1&a=index [QSA] # yhy:测试test
RewriteRule ^test$ index.php?c=test [QSA]
RewriteRule ^test/(.*)/$ index.php?c=test&a=$1 [QSA]
RewriteRule ^test/(.*)/(.*)\.html$ index.php?c=test&a=$1&id=$2 [QSA] # yhy:finance
RewriteRule ^Finance/$ index.php?c=finance [QSA]
RewriteRule ^Finance/type-(\d+)\.html$ index.php?c=finance&a=type&leixing=$1 [QSA]
RewriteRule ^Finance/(.*)\.html$ index.php?c=finance&a=detail&id=$1 [QSA]
# RewriteRule ^Finance/type-(\d+)/&page=(\d*)$ index.php?c=finance&a=index&leixing=$1&page=$2 [QSA] url:
 
 
nginx.htaccess
每次改写好后要重新启动服务器
if (!-e $request_filename) {
rewrite ^/login/$ /index.php?c=login last;
rewrite ^/loginout/$ /index.php?c=loginout last;
rewrite ^/regist/$ /index.php?c=regist last;
rewrite ^/regist/(.*)/$ /index.php?c=regist&a=$1 last;
rewrite ^/help/$ /index.php?c=help last;
rewrite ^/finance/$ /index.php?c=finance last;
rewrite ^/finance/login/(.*)\.html$ /index.php?c=center&a=login&id=$1 last;
rewrite ^/finance/(.*)\.html$ /index.php?c=finance&a=info&id=$1 last;
rewrite ^/safe/$ /index.php?c=safe last;
rewrite ^/risk/$ /index.php?c=risk last;
rewrite ^/lcc/$ /index.php?c=lcc last; rewrite ^/question/$ /index.php?c=question last;
rewrite ^/guide/$ /index.php?c=guide last;
rewrite ^/findpwd/$ /index.php?c=findpwd last;
rewrite ^/findpwd/(.*)/$ /index.php?c=findpwd&a=$1 last;
rewrite ^/center/$ /index.php?c=center last;
#关于我们
rewrite ^/about/$ /index.php?c=about last;
rewrite ^/about/(.*)/$ /index.php?c=about&a=$1 last;
rewrite ^/about/(.*)/(.*)\.html$ /index.php?c=about&a=$1&id=$2 last;
#处理一键绑定
rewrite ^/bangding/$ /index.php?c=binding last;
rewrite ^/checkcustkey/$ /index.php?c=binding&a=checkcustkey last;
#常见问题
rewrite ^/faq/$ /index.php?c=faq last;
rewrite ^/faq/(.*)/$ /index.php?c=faq&a=$1 last;
rewrite ^/faq/(.*)\.html$ /index.php?c=faq&id=$1 last;
#P2P活动
rewrite ^/p2pactive/$ /index.php?c=p2pactive last;
rewrite ^/p2pactive/page_(\d+)\.html$ /index.php?c=p2pactive&page=$1 last;
rewrite ^/p2pactive/(.*)\.html$ /index.php?c=p2pactive&a=info&id=$1 last;
#搜索c
rewrite ^/type-(\d+)-(\d+)-(\d+)/$ /index.php?c=finance&a=index&tuijian=$1&shouyi=$2&qixian=$3 last;
#短信
rewrite ^/msg/$ /index.php?c=msg last;
#保单
rewrite ^/insurance/$ /index.php?c=insurance last;
}

.htaccess 的写法的更多相关文章

  1. apache域名重定向301跳转 .htaccess的写法

    RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^baidu.com$ [NC] RewriteRule ^(.*)$ http://w ...

  2. 服务器.htaccess 详解以及 .htaccess 参数说明(转载)

    htaccess文件(或者”分布式配置文件”)提供了针对目录改变配置的方法, 即,在一个特定的文档目录中放置一个包含一个或多个指令的文件, 以作用于此目录及其所有子目录.作为用户,所能使用的命令受到限 ...

  3. .htaccess详解及.htaccess参数说明【转】

    目录(?)[-] htaccess 详解 htaccess rewrite 规则详细说明 RewriteEngine OnOff RewriteBase URL-path RewriteCond Te ...

  4. PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误

    TP框架  打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...

  5. 【转】.htaccess详解及.htaccess参数说明

    .htaccess文件(或者”分布式配置文件”)提供了针对目录改变配置的方法, 即,在一个特定的文档目录中放置一个包含一个或多个指令的文件, 以作用于此目录及其所有子目录.作为用户,所能使用的命令受到 ...

  6. .htaccess详解及.htaccess参数说明

    .htaccess文件(或者”分布式配置文件”)提供了针对目录改变配置的方法, 即,在一个特定的文档目录中放置一个包含一个或多个指令的文件, 以作用于此目录及其所有子目录.作为用户,所能使用的命令受到 ...

  7. 【转】服务器.htaccess 详解以及 .htaccess 参数说明

    htaccess文件(或者”分布式配置文件”)提供了针对目录改变配置的方法, 即,在一个特定的文档目录中放置一个包含一个或多个指令的文件, 以作用于此目录及其所有子目录.作为用户,所能使用的命令受到限 ...

  8. server.htaccess 具体解释以及 .htaccess 參数说明

    .htaccess文件(或者"分布式配置文件")提供了针对文件夹改变配置的方法. 即.在一个特定的文档文件夹中放置一个包括一个或多个指令的文件, 以作用于此文件夹及其所有子文件夹. ...

  9. Apacheserver自己定义404页面的两种方法以及.htaccess的重要命令总结

    Apacheserver自己定义404错误页面有两种方法: 第一种方法最简单,直接在Apache的httpd.conf下进行配置改动命令,改动的内容请參看.htaccess命令写法中的自己定义错误页面 ...

随机推荐

  1. bootstrap的验证和确认对话框

      BootstrapValidator: http://bv.doc.javake.cn/api/   引用 <!-- jquery-confirm.确认对话框 --> <link ...

  2. SVN 搭建

    http://www.blogjava.net/jasmine214--love/archive/2010/09/26/332989.html http://hunan.iteye.com/blog/ ...

  3. 数据库递归查询-CTE

    1.公用表表达式(CTE)的定义 公用表达式的定义包含三部分: 公用表表达式的名字(在WITH之后) 所涉及的列名(可选) 一个SELECT语句(紧跟AS之后), 公用表表达式的好处之一是可以在接下来 ...

  4. Tiny Rss Reader - 迷你RSS阅读器

    发布新软件 TinyRss: Windows平台上的一个小巧的Rss阅读器. 用户界面: 项目地址: https://github.com/movsb/tinyrss.git 测试下载: http:/ ...

  5. VC++中字符串编码的转换

    在以前VC++6.0中默认的字符集是多字节字符集(MBCS:Multi-Byte Character Set),而VS2005及以后默认的字符集是Unicode,这样导致以前在VC6.0中非常简单实用 ...

  6. Win10 AppBar

    <Page.BottomAppBar> <CommandBar x:Name="cmdBar" Background="Transparent" ...

  7. ASP.NET 5中的ASP.NET Bundles跑到哪里去了?

    (此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 众所周知,在ASP.NET MVC中很早就存在一个所谓的"bundling and ...

  8. Codeforces Round #14 D. Two Paths(求树上两条不相交的路径的乘积最大值)

    题目链接:  http://codeforces.com/problemset/problem/14/D 思路:直接枚举每一天路径的两端,然后求以每一端为树根的树上最长路径,然后相乘就可以了. # ...

  9. loj 1002(spfa变形)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=25828 题意:求所有点到给定的目标顶点的路径上的权值的最大值的最小 ...

  10. MySQL中的约束简单使用

    数据库约束是为了保证数据的完整性而实现的一套机制,它具体的根据各个不同的数据库的实现而有不同的工具.一般来说有以下几种实现方式:1.检查约束:通过在定义数据库表里,在字段级或者是在表级加入的检查约束, ...