-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.htaccess
101 lines (73 loc) · 3.98 KB
/
.htaccess
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
RewriteBase /
#RewriteBase /~rpage/biostor/
# If URL has "www" prefix strip and redirect to biostor.org
# We also need to disable default hostname (uncheck checkbox in Server Admin/Web/Sites)
#RewriteCond %{HTTP_HOST} ^www.biostor.org$ [NC]
#RewriteRule ^(.*)$ http://130.209.46.234/$1 [R=301,L]
#-----------------------------------------------------------------------------------------
# BioStor reference URL
RewriteRule ^reference/([0-9]+)/page/([0-9]+) index.php?id=biostor/$1&page=$2 [NC,L]
RewriteRule ^reference/biostor/([0-9]+)/page/([0-9]+) index.php?id=biostor/$1&page=$2 [NC,L]
# Redirects for legacy URLs from old BioStor (these URLs may appear in Google search results)
RewriteRule ^reference/([0-9]+).text$ reference/$1 [R,L]
# Reference
RewriteRule ^reference/([0-9]+)$ index.php?id=biostor/$1 [NC,L]
RewriteRule ^reference/(biostor/[0-9]+)$ index.php?id=$1 [NC,L]
# Thumbnail
RewriteRule ^reference/([0-9]+)/thumbnail$ api.php?id=biostor/$1&thumbnail [NC,L]
#-----------------------------------------------------------------------------------------
# DocumentCloud
# Document cloud image
RewriteRule ^documentcloud/biostor/([0-9]+)/pages/([0-9]+)-([a-z]+)$ api_documentcloud.php?id=biostor/$1&page=$2&size=$3 [NC,L]
# Document cloud text
RewriteRule ^documentcloud/biostor/([0-9]+)/pages/([0-9]+)$ api_documentcloud.php?id=biostor/$1&page=$2 [NC,L]
# Document cloud description
RewriteRule ^documentcloud/([0-9]+).json api_documentcloud.php?id=biostor/$1 [QSA,L]
RewriteRule ^documentcloud/biostor/([0-9]+).json api_documentcloud.php?id=biostor/$1 [QSA,L]
#-----------------------------------------------------------------------------------------
# DOI
#RewriteRule ^doi/(.*) index.php?doi=$1 [NC,L]
#-----------------------------------------------------------------------------------------
# ISSN
RewriteRule ^issn/([0-9]{4})-([0-9]{3})([0-9]|X)/year/([0-9]{4}) ?issn=$1-$2$3&year=$4 [NC,L]
RewriteRule ^issn/([0-9]{4})-([0-9]{3})([0-9]|X)$ ?issn=$1-$2$3 [NC,L]
#-----------------------------------------------------------------------------------------
# OCLC
RewriteRule ^oclc/([0-9]+)/year/([0-9]{4}) ?oclc=$1&year=$2 [NC,L]
RewriteRule ^oclc/([0-9]+)$ ?oclc=$1 [NC,L]
#-----------------------------------------------------------------------------------------
# All titles
RewriteRule ^titles/letter/([A-Z]) ?titles&letter=$1 [NC,L]
RewriteRule ^titles ?titles [NC,L]
#-----------------------------------------------------------------------------------------
# Images
RewriteRule ^images ?images [NC,L]
#-----------------------------------------------------------------------------------------
# Map
RewriteRule ^map ?map [NC,L]
#-----------------------------------------------------------------------------------------
# Labs
RewriteRule ^labs ?labs [NC,L]
#-----------------------------------------------------------------------------------------
# Search
RewriteRule ^search/(.*)/bookmark/(.*) ?q=$1&bookmark=$2 [NC,L]
RewriteRule ^search/(.*) ?q=$1 [NC,L]
#-----------------------------------------------------------------------------------------
# OpenURL
#RewriteRule ^openurl/(.*) api_openurl.php$1 [NC, L]
#-----------------------------------------------------------------------------------------
# API
RewriteRule ^reconcile(.*) api_reconciliation.php$1
#-----------------------------------------------------------------------------------------
# Image caching
RewriteRule ^page/image/(\d+)-(.*).jpg proxy.php?PageID=$1&size=$2
#-----------------------------------------------------------------------------------------
# PDF caching and viewing
# Mod rewrite seems to strip one of the forward slashes after the http[s] protocol, so
# we put it back here.
RewriteRule ^pdf/(http[s]?:)(.*) pdfproxy.php?url=$1/$2