3 AddCharset utf-8 .html .css .php .txt .js
6 RewriteBase /textfiles/
8 # Send requests without parameters to textfiles.php.
9 # RewriteRule ^$ textfiles.php [L]
11 # Send requests for index.php to textfiles.php.
12 # RewriteRule ^index\.php$ textfiles.php [L]
14 # Send requests for index.html to textfiles.php.
15 # RewriteRule ^index\.html$ textfiles.php [L]
17 # Send requests for textfiles.css to textfiles.css.
18 RewriteRule ^textfiles\.css$ textfiles.css [L]
20 # Send requests for textfiles.js to textfiles.js.
21 RewriteRule ^textfiles\.js$ textfiles.js [L]
23 # Send requests for textfiles.php to textfiles.php.
24 RewriteRule ^textfiles\.php$ textfiles.php [L]
26 # Send requests for textfiles.html to textfiles.php.
27 # NOTE: THIS IS NOT A TYPO!
28 RewriteRule ^textfiles\.html$ textfiles.php [L]
30 # Send requests for files that exist to textfiles.php (raw).
31 RewriteCond %{REQUEST_URI} ^\/textfiles\/(.+)/raw$
32 RewriteCond /file/path/to/your/textfiles/%1 -f
33 RewriteRule ^(.+)/raw$ textfiles.php?f=$1&m=raw [QSA,L]
35 # Send requests for files that exist to textfiles.php.
36 RewriteCond %{REQUEST_URI} ^\/textfiles\/(.+)$
37 RewriteCond /file/path/to/your/textfiles/%1 -f
38 RewriteRule ^(.+)$ textfiles.php?f=$1 [QSA,L]