forked from swcarpentry/DEPRECATED-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_htaccess
65 lines (50 loc) · 1.82 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
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
# Route /bootcamps to /workshops
RewriteCond %{REQUEST_URI} ^/bootcamps
RewriteRule ^bootcamps/(.*)$ /workshops/$1 [R,L]
# Route /3_0 and /4_0 pages to /v3, /v4
RewriteCond %{REQUEST_URI} ^/3_0
RewriteRule ^3_0/(.*)$ /v3/$1 [R,L]
RewriteCond %{REQUEST_URI} ^/4_0
RewriteRule ^4_0/(.*)$ /v4/$1 [R,L]
# 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]
### Wordpress Page Redirects ###
# 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]
# 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]
</IfModule>
<Files "feed.xml">
ForceType application/rss+xml
</Files>