All pastes #947892 Raw Edit

Something

public text v1 · immutable
·published 2008-03-18 19:56 UTC
rendered paste body
RewriteEngine on
Options +FollowSymlinks
AddDefaultCharset UTF-8

#Strip trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(css|pdf|images)/(.*)$
RewriteCond %{REQUEST_URI} !(.*)$
RewriteRule ^(.*)$ /web/$1 [R=301]

#Remove extensions from files except on index.php, images, javascript files and pdfs
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_URI} !\.(css|jpg|gif|js)$
RewriteRule ^(.*)\.(.*)$ /web/$1 [R=301]

#Rewrite the virtual pages to  form index.php can use
RewriteCond %{QUERY_STRING} !marker
RewriteCond %{QUERY_STRING} id=([-a-zA-Z0-9_+]+)
RewriteRule ^/?index\.php$ %1? [R=301,L]

RewriteRule ^/?([-a-zA-Z0-9_+]+)$ /web/index.php?marker&page=$1 [L]

#If a page isn't found, send it to index.php also
ErrorDocument 404 /web/index.php