This repository has been archived by the owner on Jan 3, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
_htaccess
83 lines (65 loc) · 2.56 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
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
# Wordpress URLs that are gone
RewriteRule .*/trackback/?$ - [gone,NC]
# Wordpress Feed URL
# this has to happen before the rewrites for /blog
RewriteCond %{REQUEST_URI} ^(/feed/?|/blog/feed/?)$
RewriteRule ^(.*) /feed.xml [R,L]
### Wordpress Blog Redirects ###
# redirect URLs to a day to the main blog page
RewriteCond %{REQUEST_URI} ^/\d\d\d\d/\d\d/\d\d/$
RewriteRule ^(.*) /blog/index.html [R,L]
# redirect urls that are only to a month to the main blog page
# since we don't have these monthly pages any longer
RewriteCond %{REQUEST_URI} ^/\d\d\d\d/\d\d/$
RewriteRule ^(.*) /blog/index.html [R,L]
# redirect URLs that have a year and month to the /blog/ folder
# since these are likely old links to individual blog pages
RewriteCond %{REQUEST_URI} ^/\d\d\d\d/\d\d/
RewriteRule ^(.*) /blog/$1 [R,L]
# redirect URL to just /blog/ to /blog/index.html
RewriteCond %{REQUEST_URI} ^/blog/?$
RewriteRule .* /blog/index.html [R,L]
# redirect blog URLs that don't end in .html so that they do
# since this is probably an old blog page link
RewriteCond %{REQUEST_URI} ^/blog
RewriteCond %{REQUEST_URI} !.html$
RewriteRule ^(.*?)/?$ $1.html [R,L]
### Wordpress Page Redirects ###
# Temp rewrite for Technische Universitat Munchen (jan 2013) published URL
RewriteCond %{REQUEST_URI} ^/boot-camps/boot-camp-standard-software-set-up
RewriteRule ^(.*) /setup/ [R,L]
# wordpress bootcamps URLs
RewriteCond %{REQUEST_URI} ^/boot-camps/
RewriteRule ^(.*) /bootcamps/ [R,L]
# wordpress bootcamps category URLs
RewriteCond %{REQUEST_URI} ^/category/boot-camp/
RewriteRule ^(.*) /bootcamps/ [R,L]
# About team page
RewriteCond %{REQUEST_URI} ^/about/our-team/?$
RewriteRule ^(.*) /about/team.html [R,L]
# Other about pages
RewriteCond %{REQUEST_URI} ^/about/.*$
RewriteCond %{REQUEST_URI} !.html$
RewriteRule ^(.*?)/?$ $1.html [R,L]
# reading list
RewriteCond %{REQUEST_URI} ^/4_0/reading/?$
RewriteRule ^(.*) /about/biblio.html [R,L]
# Handle 4_0 episode links that don't end in .html
RewriteCond %{REQUEST_URI} ^/4_0/[^/]+/.+
RewriteCond %{REQUEST_URI} !.html$
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*?)/?$ $1.html [R,L]
# Links to badge kind pages
# Keep redirecting this for now, so as to not break old badges
# but also incase we want to make individual badge criteria pages later on.
RewriteCond %{REQUEST_URI} ^/badges/(.*).html
RewriteCond %{REQUEST_URI} !^/badges/index.html
RewriteRule ^.*/(.*).html /badges/index.html#$1-badge [NE,R,L]
</IfModule>
<Files "feed.xml">
ForceType application/rss+xml
</Files>