1

I am running an angular1.5 app with a python/bottle api that runs under apache2.2 + wsgi. I want to use html5 mode to get clean urls (without the # in the url).

My question is how to use the apache RewriteRule to achieve this. My problem is that the apache server has two wsgi apps (one for the angularjs app and another one, unrelated). Can I create a RewriteRule that works for the angular wsgi app but doesn't affect the other?

Here is what I have now, with no RewriteRule:

WSGIDaemonProcess service user=www group=www processes=5 threads=25 home=/path/to/logs
WSGIScriptAlias /service /path/to/service.py #angularjs app
<Location /service>
  WSGIProcessGroup service
</Location>
#
WSGIDaemonProcess otherservice user=www group=www processes=5 threads=25 home=/path/to/logs
WSGIScriptAlias /otherservice /path/to/otherservice.py
<Location /otherservice>
  WSGIProcessGroup otherservice
</Location>

A link to the angular app might look like this:

http://example.com/service/task#/parm1

What I want is the link to look like this:

http://example.com/service/task/parm1

How do I use a RewriteRule to get clean (html5 mode) \urls in the first service but does not affect the otherservice?

Tim
  • 1,013
  • 3
  • 17
  • 36
  • You might want to check this answer, or modify it following that redirect logic: http://stackoverflow.com/questions/22739455/htaccess-redirect-for-angular-routes – Burak Tokak Jan 05 '17 at 17:52
  • A ``RewriteRule`` can be nested inside of a ``Location`` block. Have you tried that. – Graham Dumpleton Jan 05 '17 at 20:01

0 Answers0