一个伪静态与404重定向例子(房产网),.htaccess文件内容
ErrorDocument 404 /404.php
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.php
RewriteRule ^(.*)/file/(.*)\.php(.*)$ /404.php
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show.php?itemid=$2&page=$4
RewriteRule ^(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ $1/list.php?catid=$2&page=$4
RewriteRule ^(.*)/show/([0-9]+)/([0-9]+)?([/])?$ $1/show.php?itemid=$2&page=$3
RewriteRule ^(.*)/list/([0-9]+)/([0-9]+)?([/])?$ $1/list.php?catid=$2&page=$3
RewriteRule ^(.*)/([A-za-z0-9_\-]+)-c([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$3&page=$4
RewriteRule ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3
RewriteRule ^(com)/([a-z0-9_\-]+)/([a-z]+)/(.*)\.html$ index.php?homepage=$2&file=$3&rewrite=$4
RewriteRule ^(com)/([a-z0-9_\-]+)/([a-z]+)([/])?$ index.php?homepage=$2&file=$3
RewriteRule ^(com)/([a-z0-9_\-]+)([/])?$ index.php?homepage=$2
RewriteRule ^(house)/list-(r|b|t|p|f|l|o|h|n|g|j|e)([0-9A-Z_]+).html?$ $1/list.php?&$2=$3 [L]
RewriteRule ^(house)/list-r([0-9]+)-t([0-9]+)-p([0-9]+)-k(.*).html?$ $1/list.php?&r=$2&t=$3&p=$4&k=$5 [L]
RewriteRule ^(house)/map.html?$ map/newhouse.php [L]
RewriteRule ^(house)/([0-9]+)/?$ $1/show.php?&at=$3&itemid=$2 [L]
RewriteRule ^(house)/([0-9]+)/index.html?$ $1/show.php?&at=$3&itemid=$2 [L]
RewriteRule ^(house)/([0-9]+)/wenfang-g([0-9]+).html?$ extend/wenfang.php?mid=6&itemid=$1&page=$2 [L]
RewriteRule ^(house)/([0-9]+)/(xinxi|huxing|jiage|xiangce|wenfang|peitao|zixun|dianping|pic).html?$ $1/show.php?&at=$3&itemid=$2 [L]
RewriteRule ^(.*)/p([0-9]+)-h([0-9]+).html?$ $1/show.php?itemid=$2&houseid=$3
RewriteRule ^(house)/([0-9]+)/xiangce-c([0-9]+).html?$ $1/show.php?&at=xiangce&itemid=$2&catids=$3 [L]
RewriteRule ^(house)/baojia.html?$ $1/baojia.php [L]
#经纪人规则
RewriteRule ^(broker)/index.html$ $1/index.php [L]
RewriteRule ^(broker)/list-(r|b|t|p|f|l|o|h|n|g|c|y|e|m|u|i)([0-9_]+).html?$ $1/index.php?&$2=$3 [L]
RewriteRule ^(broker)/list-(.*).html?$ $1/index.php?¶m=$2
#二手房规则
RewriteRule ^(sale)/map.html?$ map/index.php [L]
RewriteRule ^(rent)/map.html?$ map/rent.php [L]
RewriteRule ^(map)/rent.html?$ map/rent.php [L]
RewriteRule ^(map)/sale.html?$ map/index.php [L]
RewriteRule ^(map)/house.html?$ map/newhouse.php [L]
RewriteRule ^(.*)/list.html$ $1/list.php [L]
RewriteRule ^(.*)/list-([a-z]+)([0-9A-Z_]+).html?$ $1/list.php?&$2=$3
RewriteRule ^(.*)/list-k(.*).html?$ $1/list.php?&k=$2 [L]
RewriteRule ^(.*)/list-(.*).html?$ $1/list.php?¶m=$2 [L]
RewriteRule ^(.*)/pk/(.+)?$ $1/compare.php?&itemid=$2 [L]
#小区规则
RewriteRule ^(community)/([0-9]+)/?$ $1/show.php?&at=$3&itemid=$2 [L]
RewriteRule ^(community)/([0-9]+)/index.html?$ $1/show.php?&at=$3&itemid=$2 [L]
RewriteRule ^(community)/([0-9]+)/(sale|rent|price|map).html?$ $1/show.php?&at=$3&itemid=$2 [L]
RewriteRule ^(community)/([0-9]+)/(sale|rent)-(p|c|i|u|h|n|e|m|g)([0-9_]+).html?$ $1/show.php?&at=$3&itemid=$2&$4=$5 [L]
RewriteRule ^(community)/([0-9]+)/(sale|rent)-(.*).html?$ $1/show.php?&at=$3&itemid=$2¶m=$4 [L]
RewriteRule ^(.*)/search.html$ $1/search.php [L]
RewriteRule ^(.*)/search-k([^/-]+).html$ $1/search.php?&kw=$2 [L]
RewriteRule ^(.*)/search-([^/-]+)-p([0-9]+).html$ $1/search.php&kw=$2&page=$3[L]
RewriteRule ^(.*)/(.*)\.htm$ $1/404.php
一个伪静态与404重定向例子(房产网),.htaccess文件内容的更多相关文章
- 四个例子实战讲解.htaccess文件rewrite规则(转)
一.防盗链功能 1 2 3 4 RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.+.)?mysite.com/ [NC] Rewrite ...
- Apache伪静态(Rewrite).htaccess文件详解
Htaccess(超文本访问)是一个简单的配置文件,它允许设计师,开发者和程序员通过它来改变Apache Web服务器的配置.这些功能包括用户重定向.URL重写(url rewrite,国内很多称为伪 ...
- URL重定向之一.htaccess文件和AllowOverride指令
通常利用Apache的rewrite模块对URL进行重写的时候,rewrite规则会写在 .htaccess文件里.但是要使Apache能够正常读取 .htaccess文件的内容,就必须对 .htac ...
- php中读取文件内容的几种方法。(file_get_contents:将文件内容读入一个字符串)
php中读取文件内容的几种方法.(file_get_contents:将文件内容读入一个字符串) 一.总结 php中读取文件内容的几种方法(file_get_contents:将文件内容读入一个字符串 ...
- vue嵌套路由 && 404重定向
第一部分: vue嵌套路由 嵌套路由是什么? 嵌套路由就是在一个被路由过来的页面下可以继续使用路由,嵌套也就是路由中的路由的意思. 比如在vue中,我们如果不使用嵌套路由,那么只有一个<rou ...
- vue嵌套路由与404重定向实现方法分析
第一部分: vue嵌套路由 嵌套路由是什么? 嵌套路由就是在一个被路由过来的页面下可以继续使用路由,嵌套也就是路由中的路由的意思. 比如在vue中,我们如果不使用嵌套路由,那么只有一个<rout ...
- IIS7.5+WebConfig实现页面伪静态和301重定向
IIS7.5+WebConfig实现页面伪静态和301重定向 使用URLRewriter组件在windows 2003 +iis 6.0下配置伪静态的文章网络上一大堆.但在iis7.0或iis 7.5 ...
- php这是一个随机打印输出字符串的例子
<?php header("Content-type:text/html;charset='utf8'"); error_reporting(E_ALL); define(& ...
- [转]一个简单的Linux多线程例子 带你洞悉互斥量 信号量 条件变量编程
一个简单的Linux多线程例子 带你洞悉互斥量 信号量 条件变量编程 希望此文能给初学多线程编程的朋友带来帮助,也希望牛人多多指出错误. 另外感谢以下链接的作者给予,给我的学习带来了很大帮助 http ...
随机推荐
- Django—处理流程
用户通过浏览器发送请求 请求到达request中间件,中间件对request请求做预处理或者直接返回response 若未返回response,会到达urlconf路由,找到对应视图函数 视图函数做相 ...
- 第2章 python入门
基本数据类型(int, bool, str) 1.1 python基本数据类型 1.int ==> 整数. 主要⽤来进⾏数学运算 2.str ==> 字符串 可以保存少量数据并进⾏相应的操 ...
- C++-cin与scanf cout与printf效率问题
http://blog.csdn.net/l2580258/article/details/51319387 void cin_read_nosync() { freopen("data.t ...
- Java&Selenium借助AutoIt 实现非Input类型自动化上传文件
通常情况下实现自动化上传文件,都是通过sendKeys函数直接将文件全路径传给页面空间就能完成,然而这种情况只能对Input类型的控件有效,对于非Input类型的控件可以借助AutoIt来完成 下载地 ...
- CentOS下更改yum源
centos下下载工具为yum,对应的源在/etc/yum.repos.d/CentOS-Base.repo文件下,修改其URI中前面的网络地址即可
- 少有人知的 GitHub 使用技巧
GitHub 大家常上吧?可是使用 GitHub 的各种小窍门你就不一定知道了.本文将各种使用 GitHub 的小窍门分享给大家. diff时忽略空格 有些修改只是增减了空格,在URL中添加?w=1就 ...
- IE的F12开发人员工具不显示 转载自:http://blog.csdn.net/longyulu/article/details/8749705
IE的F12开发人员工具不显示问题: 按下F12之后,开发人员工具在桌面上看不到,但是任务栏里有显示.将鼠标放在任务栏的开发人员工具上,出现一片透明的区域,选中之后却出不来.将鼠标移动到开发人员工具的 ...
- indexedDB 前端数据库(使用的简单案例)
前端存储 之 indexDB 1.indexedDB是什么? indexedDB是一个非关系型数据库 它不需要我们去写一些特定的SQL语句来对数据库进行操作 它是NoSQL的,数据形式使用的json ...
- 【leetcode】1296. Divide Array in Sets of K Consecutive Numbers
题目如下: Given an array of integers nums and a positive integer k, find whether it's possible to divide ...
- 上下文管理器和else块
一.if 语句之外的 else块 else 子句不仅能在 if 语句中使用,还能在for.while和try语句中使用. (1)for :仅当 for 循环运行完毕时(即 for 循环没有被break ...