-
Notifications
You must be signed in to change notification settings - Fork 0
/
urlrewrite.xml
71 lines (64 loc) · 2.69 KB
/
urlrewrite.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN" "http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite>
<rule>
<note>
Disable CFML Admin Contexts
</note>
<condition type="remote-addr" operator="notequal" next="or">127.0.0.1</condition>
<condition name="host" operator="notequal" next="or">127.0.0.1</condition>
<from>^/(railo-context|lucee|cfide|bluedragon)/admin.*$</from>
<set type="status">404</set>
<to last="true">/404.html</to>
</rule>
<rule>
<note>
Remove query string when it contains cfid, cftoken, or jsessionid.
This is to prevent accidental or deliberate session leaking.
</note>
<condition type="query-string" operator="equal">\b(cfid|cftoken|jsessionid)=</condition>
<from>^(.*)$</from>
<to type="permanent-redirect" last="true">$1</to>
</rule>
<rule>
<note>
Remove bulk of URL when it contains suspicious ;jsessionid= or ;cftoken=, etc.
This is to put an end to suspicious session fixation attack scanning.
</note>
<from>^(.*);(jsessionid|cftoken|cfid)=.*$</from>
<to type="permanent-redirect" last="true">$1</to>
</rule>
<rule>
<name>Add trailing slash to directories without a trailing slash</name>
<from>^(.*\/[^/\.]+)$</from>
<to type="permanent-redirect" last="true">$1/</to>
</rule>
<rule>
<note>
All request to *.html or ending in / will be rewritten to /index.cfm
</note>
<from>^(/((.*?)(\.html|/))?)$</from>
<to last="true">%{context-path}/index.cfm</to>
</rule>
<rule>
<note>
All request to system static assets that live under /preside/system/assets
should go through CFML and will be rewritten to /index.cfm
</note>
<from>^/preside/system/assets/.*$</from>
<to last="true">%{context-path}/index.cfm</to>
</rule>
<rule>
<note>
All the following requests should not be allowed and should return with a 404
We block any request to:
* the application folder (where all the logic and views for your site lives)
* the uploads folder (should be configured to be somewhere else anyways)
* this url rewrite file!
* Application.cfc
</note>
<from>^/(application/|preside/|uploads/|urlrewrite\.xml\b|Application\.cfc\b)</from>
<set type="status">404</set>
<to last="true">/404.html</to>
</rule>
</urlrewrite>