Skip to content

Instantly share code, notes, and snippets.

@erikrose
Created March 8, 2013 19:01
Show Gist options
  • Save erikrose/5118912 to your computer and use it in GitHub Desktop.
Save erikrose/5118912 to your computer and use it in GitHub Desktop.
# Not strictly necessary but should save a lot of RewriteConds and fstats:
RewriteRule ^/search$ - [L]
RewriteRule ^$ - [L]
RewriteRule ^/static($|/.*) - [L]
RewriteRule ^.*/$ - [L] # Don't muck with the front page or any directory-browing page.
# Append ".html" to files in the tree but not to ones that exist as requested...
RewriteCond /home/vagrant/dxr/tests/test_basic/target/trees%{REQUEST_FILENAME} !-f
# ...and not to folders:
RewriteCond /home/vagrant/dxr/tests/test_basic/target/trees%{REQUEST_FILENAME} !-d
# Don't report a 404 on a rewritten address; that's confusing:
RewriteCond /home/vagrant/dxr/tests/test_basic/target/trees%{REQUEST_FILENAME}.html -f
RewriteRule (.*) %{REQUEST_FILENAME}.html [L,PT]
DirectoryIndex '.dxr-directory-index.html' index.html
Alias /static/ /home/vagrant/dxr/dxr/static/ # for JS, CSS, and images
AliasMatch ^((?!/search$).*$) /home/vagrant/dxr/tests/test_basic/target/trees/$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment