0

I'm writing a single page application using Angular 1.4, and I'd like to add a rewrite rule to nginx using a regular expression so that an external link doesn't need to include the hashtag, and it will get added automatically, like this:

mywebsite.com/hotel/17263?guests=2 -> mywebsite.com/#/hotel/17263?guests=2

I want to avoid hard-coding the name of the website inside the rewrite rule. Also, because I have other assets being served from the same server, the rewrite rule needs to only affect those URLs that start with either /hotel, /hotels or /area, or that point to / (root directory).

Rob Hall
  • 1
  • 2
  • I'm pretty sure you have some other assets on this domain that you don't want to rewrite, like images/styles/scripts… – Alexey Ten Oct 07 '15 at 17:50
  • Good point! I would only want to rewrite URLs starting with /hotel, /hotels or /area. I updated the question to reflect that. – Rob Hall Oct 07 '15 at 20:28

0 Answers0