0

I am using react-router within my reactjs application and do not like the /#/ prefix it gives. I removed this easily by setting it to use HTML 5 history, but now on reload it sends requests to the server for the specific URL. I want to instead send these requests to the index.html file. I do not want to handle this from a backend. I am thinking a .htaccess setup might work but haven't been able to get this right.

Any and all help is appreciated.

WiredPrairie
  • 58,954
  • 17
  • 116
  • 143
Julien Vincent
  • 1,210
  • 3
  • 17
  • 40
  • Using an `.htaccess` file is the correct way to do this. Show us what it looks like now, then we can help you write the necessary rewrite rules. –  Mar 25 '15 at 21:38
  • I'm afraid I removed what I wrote. Also realized .htaccess doesn't work with nginx I think? What can I use for nginx – Julien Vincent Mar 25 '15 at 21:57
  • It's more complicated then in question @WiredPrairie mentioned but still have nothing to do with `.htaccess`. I think lots of people already set up such thing, google is good helper there. – Dmitry Verhoturov Mar 26 '15 at 07:05
  • Actually, @DmitryVerkhoturov, it's really not more complicated than that, especially given how little information was provided in the question. There are other answers with more options: http://stackoverflow.com/questions/26093270/nginx-how-to-let-rewrite-rules-ignore-files-or-folders – WiredPrairie Mar 26 '15 at 10:32
  • Thanks @WiredPrairie the links you shared are exactly what I needed! If you think this question should be marked duplicate then I will. – Julien Vincent Mar 26 '15 at 10:56

0 Answers0