1

We use js to write front pages. But when we access some pages the url in browser like www.xxx.com/#/login. Is there some way to remove the # from url by Nginx so that we can access the resource by www.xxx.com/login? Thanks in advance.

PS: nginx version:1.10.1

Binary
  • 81
  • 8
  • Hashbangs are never sent to the server - they're parsed after the site is loaded. Nginx is a server, it doesn't ever receive them. You can remove them with javascript if you wish (by using eg. the history api, but it seems you guys are already doing that). So in general you'd have to convert the entire site from a javascript hashbang solution into a regular solution. There's no "simple fix" unless you want to maintain the javascript solution. – h2ooooooo Aug 29 '16 at 06:50
  • OK. got it. Thanks a lot , :) – Binary Aug 30 '16 at 01:29
  • Possible duplicate of [URL Fragment and 302 redirects](http://stackoverflow.com/questions/2286402/url-fragment-and-302-redirects) – tripleee Aug 30 '16 at 11:10
  • 1
    The character is called "hash". The term "hashbang" refers to the combination "#!" (hash, bang!) which is frequently found on the first line of Unix shell scripts. – tripleee Aug 30 '16 at 11:11
  • Similar https://stackoverflow.com/questions/5304893/mod-rewrite-rule-to-remove-from-url – Nikhil Sahu Feb 06 '19 at 06:50

0 Answers0