forked from tophtucker/Orient-BONUS-2.0
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.htaccess
94 lines (81 loc) · 3.96 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
RewriteEngine on
# Map Date, Section, Id to new URL Pattern %1=date %2=section %3=id
# NOTE: ? at end of string is to remove querystring from orig URI
# http:https://orient.bowdoin.edu/orient/article.php?date=2012-05-04§ion=1&id=1
#
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/article\.php
RewriteCond %{QUERY_STRING} ^date=([0-9]*-[0-9]*-[0-9]*)§ion=([0-9]*)&id=([0-9]*)$
RewriteRule ^(.*)$ http:https://bowdoinorient.com/article/triplet/%1/%2/%3? [R=301,L]
# Map Issue Browse
# http:https://orient.bowdoin.edu/orient/index.php?date=2012-05-04
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/index\.php
RewriteCond %{QUERY_STRING} ^date=([0-9]*-[0-9]*-[0-9]*)$
RewriteRule ^(.*)$ http:https://bowdoinorient.com/browse/%1? [R=301,L]
# Map Series Page
# http:https://orient.bowdoin.edu/orient/seriespage.php?seriespage.php?seriesid=114
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/seriespage\.php
RewriteCond %{QUERY_STRING} ^seriesid=([0-9]*)$
RewriteRule ^(.*)$ http:https://bowdoinorient.com/series/%1? [R=301,L]
# Map authorpage.php %1=authorid
# http:https://orient.bowdoin.edu/orient/authorpage.php?authorid=654
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/authorpage\.php
RewriteCond %{QUERY_STRING} ^authorid=([0-9]*)$
RewriteRule ^(.*)$ http:https://bowdoinorient.com/author/%1? [R=301,L]
# Map Archives
# http:https://orient.bowdoin.edu/orient/archives/*
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/archives(.*)$
RewriteRule ^(.*)$ http:https://bowdoinorient.com/legacy%1? [R=301,L]
##############################
# FOR iPHONE APP #
# article_iphone: date, section, id
# e.g. http:https://orient.bowdoin.edu/orient/article_iphone.php?date=2012-12-07§ion=1&id=1
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/article_iphone\.php
RewriteCond %{QUERY_STRING} ^date=([0-9]*-[0-9]*-[0-9]*)§ion=([0-9]*)&id=([0-9]*)$
RewriteRule ^(.*)$ http:https://bowdoinorient.com/api/article_iphone/%1/%2/%3? [R=301,L]
# xml_articlelist: date, section
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/xml_articlelist\.php
RewriteCond %{QUERY_STRING} ^date=([0-9]*-[0-9]*-[0-9]*)§ion=([0-9]*)$
RewriteRule ^(.*)$ http:https://bowdoinorient.com/api/xml_articlelist/%1/%2? [R=301,L]
# xml_issuelist: volume
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/xml_issuelist\.php
RewriteCond %{QUERY_STRING} ^volume=([a-zA-Z0-9]*)$
RewriteRule ^(.*)$ http:https://bowdoinorient.com/api/xml_issuelist/%1? [R=301,L]
# xml_volumelist: [no params]
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteCond %{REQUEST_URI} ^/orient/xml_volumelist\.php
RewriteRule ^(.*)$ http:https://bowdoinorient.com/api/xml_volumelist/? [R=301,L]
##############################
# Redirect old host names to new site root
RewriteCond %{HTTP_HOST} ^orient\.bowdoin\.edu$ [OR]
RewriteCond %{HTTP_HOST} ^orient [OR]
RewriteCond %{HTTP_HOST} ^bowdoinorient.org
RewriteRule ^(.*)$ http:https://bowdoinorient.com [R=301,L]
# For MVC
RewriteCond $1 !^(index\.php|js|css|images|img|ads|files|legacy|robots\.txt|phpinfo\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]