Is there a way to make Python SimpleHTTPServer support mod_rewrite?
I am trying to use Ember.js using the API History API as a location API and for it to work I have to:
1) add some vhosts config in WAMP (not simple), or
2) run python -m simpleHTTPServer (very simple)
So, when I opened it in the browser, localhost:3000and clicked the navigation (for example, about users and users), it worked well. URLs changed with Ember.js to localhost:3000/aboutand localhost:3000/usersrespectively.
But when I tried to open localhost:3000/aboutdirectly on a new tab, the python web server just returns 404.
I had my .htaccess redirecting everything to index.html, but I suspect that the simple python web server does not really read the htaccess file (am I doing this right?)
I tried downloading PHP 5.4.12 and starting the embedded web server, url and htaccess mod_rewrite work well. But I'm still reluctant to upgrade from a stable value of 5.3 to (probably still unstable) 5.4.12, so if there is a way to support mod_rewrite in a simple python web server, this would be preferable.
Thanks for the answer.
source
share