-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.httpd.conf.extract.txt
executable file
·51 lines (40 loc) · 1.95 KB
/
.httpd.conf.extract.txt
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
# Apache httpd.conf extract providing URL routing and other directives
# Example usage in httpd.conf:
#
# # Assessments
# Include /path/to/news/.httpd.conf.extract.txt
# Use MacroNews "/news/add" "News system" "/path/to/images/"
<Macro MacroNews $applicationBaseUrl $imageDirectory>
Use MacroFrontControllerApplication "$applicationBaseUrl/" "News system"
# Sinenomine integration
Use MacroSinenomineEmbeddedTable "$applicationBaseUrl" "/articles" "articles"
# Main application directives
RewriteEngine on
RewriteRule ^$applicationBaseUrl/(submit).html$ $applicationBaseUrl/index.html?action=$1 [L,QSA]
RewriteRule ^$applicationBaseUrl/(export)/$ $applicationBaseUrl/index.html?action=$1 [L,QSA]
RedirectMatch permanent ^$applicationBaseUrl/(export)$ $applicationBaseUrl/$1/
# Exporting
RewriteRule ^$applicationBaseUrl/export/([a-z]+).html$ $applicationBaseUrl/index.html?action=exportformat&item=$1 [L,QSA]
RewriteRule ^$applicationBaseUrl/export/(feed).rss$ $applicationBaseUrl/index.html?action=exportformat&item=$1 [L,QSA]
RewriteRule ^$applicationBaseUrl/export/(feed.atom).xml$ $applicationBaseUrl/index.html?action=exportformat&item=$1 [L,QSA]
RewriteRule ^$applicationBaseUrl/export/(json).json$ $applicationBaseUrl/index.html?action=exportformat&item=$1 [L,QSA]
<LocationMatch ^$applicationBaseUrl/export/(([a-z]+).html|feed.rss|feed.atom.xml|json.json)$>
php_value auto_prepend_file none
php_value auto_append_file none
</LocationMatch>
# Client-side
<LocationMatch /news/feed.(rss|atom.xml)>
php_value auto_prepend_file none
php_value auto_append_file none
</LocationMatch>
<Location /news/feed.rss>
AddType application/x-httpd-php .rss
Header Set Content-Type "application/rss+xml; charset=utf-8"
</Location>
<Location /news/feed.atom.xml>
AddType application/x-httpd-php .atom.xml
Header Set Content-Type "application/atom+xml; charset=utf-8"
</Location>
# Image source
Alias /images/news/ "$imageDirectory"
</Macro>