-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.htaccess
More file actions
34 lines (24 loc) · 870 Bytes
/
.htaccess
File metadata and controls
34 lines (24 loc) · 870 Bytes
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
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.24ways\.org$ [NC]
RewriteRule ^(.*)$ http://24ways.org/$1 [R=301,L]
# ye olde urls
RewriteRule ^advent/(.*)/$ /2005/$1/ [R,L]
# authors
RewriteRule ^authors/$ /authors.php [L]
RewriteRule ^authors/([a-z0-9-]+)/$ /author.php?slug=$1 [L]
# years
RewriteRule ^([0-9][0-9][0-9][0-9])/$ /year.php?year=$1 [L]
# article
RewriteRule ^([0-9][0-9][0-9][0-9])/([a-zA-Z0-9-\.]+)/$ /article.php?year=$1&slug=$2 [L]
# short link
RewriteRule ^([0-9][0-9][0-9][0-9])([0-9][0-9])/$ /shortlink.php?year=$1&day=$2 [L]
# comment voting
RewriteRule ^vote/(up|down)/c([0-9]+)/$ /vote.php?type=$1&commentID=$2 [L]
# search
RewriteRule ^search/$ /search.php [QSA,L]
# rss
RewriteRule ^rss/$ /rss.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ /$1/ [L,R=301]