forked from jsbin/jsbin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
33 lines (25 loc) · 1.03 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
<IfModule mod_rewrite.c>
# $Id: .htaccess,v 1.3 2006/11/09 09:08:14 remy Exp $
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteBase /
# strip www. from the domain
RewriteCond %{HTTP_HOST} ^www\.jsbin\.com$ [NC]
RewriteRule ^(.*)$ http://jsbin.com/$1 [R=301,L]
# following two versions controlled through config.php
# rule to allow dynamic versioning of our code when live and hit a sprocketized script
# generic rule for future projects, but could be js/([0-9\.]+)/jsbin\.js js/jsbin-$1.js
RewriteRule js/([0-9\.]+)/(.*)\.js js/$2-$1.js [QSA]
# role a sprocket for offline and debug
RewriteRule js/debug/.*\.js$ sprocketize.php [QSA]
# RewriteRule \.js$ sprocketize.php [QSA]
# RewriteRule \.css$ lib/sprocketize.php [QSA]
# if the file or directory exists
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [L]
# using 'index.php' because it forces a '/' request to the handler
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>