---
title: "Apache Http Server Rewrite"
author: "yunchow"
date: "2012-06-04T13:13:30Z"
tags: []
categories: ["行业应用"]
slug: "apache-http-server-rewrite"
draft: false
lastmod: "2012-06-04T13:13:30Z"
id: 1550303
url: "https://yunchow.iteye.com/blog/1550303"
---

apache的rewrite功能很强大，详细参考：http://lamp.linux.gov.cn/Apache/ApacheMenu/rewrite/index.html

用法如下步骤：
1，加载Rewrite模块
LoadModule rewrite_module modules/mod_rewrite.so

2，打开引擎
RewriteEngine on

3，编写重写规则与条件
RewriteLogLevel 9
RewriteLog "C:/rewrite.log"

RewriteCond %{DOCUMENT_ROOT}$0 !-f
RewriteRule ^/img/((.+)_(\d+))\.(jpg|png|gif|bmp)$ /img/default/p_$3.jpg


详细重写可参考日志