re-route index to fix #196
modify regexp on replacement to fix #240