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. java 接口与继承

    一.继承条件下的构造方法调用 运行 TestInherits.java 示例,观察输出,注意总结父类与子类之间构造方法的调用关系修改Parent构造方法的代码,显式调用GrandParent的另一个构 ...

  2. sqlplus使用(一)

    一,sqlplus 环境变量 sqlplus的环境变量(来自SQL*Plus® User's Guide and Reference Release 11.2) Parameter or Variab ...

  3. 简单的redis 性能测试

    C:\Users\luhan.qian\Desktop\Tools\redis C:\Users\luhan.qian\Desktop\Tools\redis $ redis-benchmark.ex ...

  4. memcache(使用php操作memcache)

    .概念 memcache 是一个高效的分布式的内存对象缓存系统,他可以支持把php的各种数据(数组,对象,基本数据类型)放在它管理的内存中 . 安装步骤 1.下载php_memcache.dll文件并 ...

  5. WPF中使用ReportViewer报表

    本篇博客将介绍如何在WPF中使用ReportViewer控件. 1. 环境准备:下载安装最新版ReportViewer(PS:需要安装Microsoft SQL Server System CLR T ...

  6. 【leetcode】plus One

    问题描述: Given a non-negative number represented as an array of digits, plus one to the number. The dig ...

  7. 第十八篇:在SOUI中实现PreTranslateMessage

    在MFC中,通常可以通过重载CWnd::PreTranslateMessage这样一个虚函数来实现对一些窗口消息的预处理.多用于tooltip的显示控制. 在SOUI中也实现了类似的机制. 要在SOU ...

  8. HDU 4005 The war Tarjan+dp

    The war Problem Description   In the war, the intelligence about the enemy is very important. Now, o ...

  9. java杂记——数组拷贝

    这里介绍两种java提供的数组拷贝方法: (1)Arrays提供的copyOf(T src, T desLength)和copyOfRange(T src, int from, int to) (2) ...

  10. zoj 3471(状态压缩)

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4257 dp[state]表示当前状态为state时的所能获得的最大值 ...