一个伪静态与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
相关文章
- python读写文件write和flush
- 给你讲清楚什么是文件上传漏洞
- java实现遍历树形菜单方法——映射文件VoteTree.hbm.xml
- Gin框架配置静态文件static
- 解决Tomcat无法加载css和js等静态资源文件
- Linux下统计目录下文件及文件夹的个数
- Ubuntu 下用命令行快速打开html,mp3等文件
- php之文件上传简单介绍
- 一个伪静态与404重定向例子(房产网),.htaccess文件内容
- Jenkins 更新网站静态文件
- Geomesa-Hbase单机部署及ingest、export shp文件数据
- ASP.NET Core静态文件中间件[5]: DirectoryBrowserMiddleware & DefaultFilesMiddleware
- ASP.NET Core静态文件中间件[4]: StaticFileMiddleware 中间件全解析
- ASP.NET Core静态文件中间件[1]: 搭建文件服务器
- ASP.NET Core应用针对静态文件请求的处理[4]: DirectoryBrowserMiddleware中间件如何呈现目录结构
- hadoop 编码实现文件传输、查看等基本文件控制
- 使用ABAP和JavaScript代码生成PDF文件的几种方式
- 猿创征文|Android 11.0 recovery恢复出厂设置保留某些文件功能实现
- ASCII与Unicode编码消息写文件浅析
- Linux在什么样的从脚本文件数据库sh格式改变sql格式
- Win11系统运行bat文件乱码怎么办?
- C++如何将Unicode文本写到日志文件中
- scp上传文件到远程服务器
- 黑客入门利器,dvwa文件上传漏洞,带你进入黑客大门