锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
涓嬮潰鏄竴涓祴璇曚簩綰у煙鍚嶆槧灝勮鍒?br />
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[^www.]+.test.ecom$
Rewriterule ^(.+) %{HTTP_HOST}$1 [C]聽
Rewriterule ^([^www.]+)\.test\.ecom(.*) /shop_$1$2
Rewriterule ^www.test.ecom(.*) /$1 [nc,PT]
RewriteRule /shop_(.+)/pic/(.*)$ /pic/$2 [nc,PT]
RewriteRule /shop_(.+)/js/(.*)$ /js/$2 [nc,PT]
RewriteRule /shop_(.+)/css/(.*)$ /css/$2 [nc,PT]
RewriteRule /shop_(.+)/(.+).do?(\.*)$聽 /$2.do?domainName=$1&%{QUERY_STRING} [L,nc]
RewriteLog "logs/rewrite.log"
RewriteLogLevel 3
鍏抽敭瀛楁:
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 RewriteCond 琛ㄧず濡傛灉鏉′歡婊¤凍鍒欎嬌鐢ㄤ笅闈㈢殑Rewriterule
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Rewriterule 灝辨槸閲囩敤鍏蜂綋鐨勬鍒欒〃杈懼紡鏉ュ尮閰嵚?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Rewriterule 鍚庨潰榪樺彲浠ュ甫鏈夊弬鏁?br />
聽聽聽聽聽聽聽聽聽聽聽聽 瑙乤pache鍙傝?br />聽聽聽聽聽聽聽聽聽聽 http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
聽聽聽聽聽聽聽聽聽
chain|C
' (chained with next rule).www
'' part, inside a per-directory rule set, when you let an external redirect happen (where the ``.www
'' part should not occur!).
cookie|CO=
NAME:VAL:domain[:lifetime[:path]]' (set cookie)env|E=
VAR:VAL' (set environment variable)$N
and %N
) which will be expanded. You can use this flag more than once, to set more than one variable. The variables can later be dereferenced in many situations, most commonly from within XSSI (via <!--#echo var="VAR"-->
) or CGI ($ENV{'VAR'}
). You can also dereference the variable in a later RewriteCond pattern, using %{ENV:VAR}
. Use this to strip information from URLs, while maintaining a record of that information.
forbidden|F
' (force URL to be forbidden)gone|G
' (force URL to be gone)handler|H
=Content-handler' (force Content handler)mod_alias
directive ScriptAlias
, which internally forces all files inside the mapped directory to have a handler of ``cgi-script
''.
last|L
' (last rule)last
command or the break
command in C. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL ('/
') to a real one, e.g., '/e/www/
'.
next|N
' (next round)next
command or the continue
command in C. Use this flag to restart the rewriting process - to immediately go to the top of the loop.nocase|NC
' (no case)noescape|NE
' (no URI escaping of output)RewriteRule /foo/(.*) /bar?arg=P1\%3d$1 [R,NE]
/foo/zed
' into a safe request for '/bar?arg=P1=zed
'.
nosubreq|NS
' (not for internal sub-requests)mod_include
tries to find out information about possible directory default files (index.xxx
files). On sub-requests it is not always useful, and can even cause errors, if the complete set of rules are applied. Use this flag to exclude some rules.proxy|P
' (force proxy)http://
hostname) which can be handled by the Apache proxy module. If not, you will get an error from the proxy module. Use this flag to achieve a more powerful implementation of the ProxyPass directive, to map remote content into the namespace of the local server.
Note: mod_proxy
must be enabled in order to use this flag.
passthrough|PT
' (pass through to next handler)uri
field of the internal request_rec
structure to the value of the filename
field. This flag is just a hack to enable post-processing of the output of RewriteRule
directives, using Alias
, ScriptAlias
, Redirect
, and other directives from various URI-to-filename translators. For example, to rewrite /abc
to /def
using mod_rewrite
, and then /def
to /ghi
using mod_alias
:
RewriteRule ^/abc(.*) /def$1 [PT]
Alias /def /ghi
PT
flag, mod_rewrite
will rewrite uri=/abc/...
to filename=/def/...
as a full API-compliant URI-to-filename translator should do. Then mod_alias
will try to do a URI-to-filename transition, which will fail.
Note: You must use this flag if you want to mix directives from different modules which allow URL-to-filename translators. The typical example is the use of mod_alias
and mod_rewrite
.
qsappend|QSA
' (query string append)redirect|R
[=code]' (force redirect)http://thishost[:thisport]/
(which makes the new URL a URI) to force a external redirection. If no code is given, a HTTP response of 302 (MOVED TEMPORARILY) will be returned. If you want to use other response codes in the range 300-400, simply specify the appropriate number or use one of the following symbolic names: temp
(default), permanent
, seeother
. Use this for rules to canonicalize the URL and return it to the client - to translate ``/~
'' into ``/u/
'', or to always append a slash to /u/
user, etc.http://thishost[:thisport]/
to the URL, and rewriting will continue. Usually, you will want to stop rewriting at this point, and redirect immediately. To stop rewriting, you should add the 'L' flag.
skip|S
=num' (skip next rule(s))skip=N
, where N is the number of rules in the else-clause. (This is not the same as the 'chain|C' flag!)
type|T
=MIME-type' (force MIME type).php
files to be displayed by mod_php
if they are called with the .phps
extension:
RewriteRule ^(.+\.php)s$ $1 [T=application/x-httpd-php-source]
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
FAQ:
聽聽聽聽 Error:聽 Expected fromat '3' of repository;found format '5'
聽聽聽聽聽聽聽聽聽聽聽聽 use "--pre-1.4-compatible", default format is "5" !!
聽聽聽聽聽聽聽聽聽聽聽
Integrate Guide:
聽聽聽聽聽聽聽聽聽聽聽 I聽 use other complie svn module for apache 2.2.3 ,
聽聽聽聽 Step1:
聽聽聽聽聽聽聽聽聽聽聽聽 copy *.dll to聽 %APACHE_HOME%\bin
聽聽聽聽聽聽聽聽聽聽聽聽 copy *.so聽 to聽 %APACHE_HOME%\modules
聽聽聽聽 Step2:
聽聽聽聽聽聽聽聽聽聽聽聽 edit %APACHE_HOME%\conf\httpd.conf
聽聽聽聽聽聽聽聽聽聽聽聽 find:
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 #LoadModule dav_module聽 modules\mod_dav.so
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 #LoadModule dav_fs_module modules\mod_dav_fs.so
聽聽聽聽聽聽聽聽聽聽聽聽 change: "#" to ""
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 LoadModule dav_module聽 modules\mod_dav.so
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 LoadModule dav_fs_module modules\mod_dav_fs.so
聽聽聽聽聽聽聽聽聽聽聽聽 and add SVN Module:
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 #SVN
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 LoadModule dav_svn_module聽聽 modules\mod_dav_svn.so
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 LoadModule authz_svn_module聽 modules\mod_authz_svn.so
聽聽聽聽聽 Step3:聽
聽聽聽聽聽聽聽聽聽聽聽聽聽 config聽 SVN auth,add httpd.conf
聽聽聽聽聽聽聽聽聽聽聽聽聽 use apache basic auth,gen password file
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 %APACHE_HOME%\bin\htpasswd -cm D:/server/webservice/clear/Apache2.2/svn-auth/svn-auth-file harry
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <IfModule dav_svn_module>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <Location /svn>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 DAV svn
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 SVNParentPath D:/SubversionRoot
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 AuthTypeBasic
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 AuthName "Subversion Repository"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 AuthUserFile D:/server/webservice/clear/Apache2.2/svn-auth/svn-auth-file
聽聽聽聽聽聽 Require valid-user
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </Location>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </IfModule>
聽聽聽聽聽聽聽
涓昏灝辨槸svn瀹樻柟鐨剋in binary涓嶆敮鎸乤pache 2.2鐨勬柊module璋冪敤銆?br />聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
聽