0

I want to build a single page application website. I want to have data from a json file with an id attribute. I want to maintain the image of SPA website. Therefore, I want to limit the visibility of the link.

So if someone enters "myurl/id=1234" or "myurl/1234" or whatever. But then my site app processes this information, shows the website but with the json information and not the main page but also maintains the single "myurl" on the browser itself.

Note: I intend to have a "share" button that gives the url in case the user wants come back to the page of just that json information. I can't find a tutorial that will cover this. I am not sure of the proper name of the topic.

Cit5
  • 400
  • 5
  • 19

1 Answers1

0

The browser is in control of the url. If you want a link to download a file, you have to send the appropriate response headers. Most languages allow you to force the response to download a file and most browsers will handle this by downloading the file without changing the url.

See this answwer: How to force file download with PHP

Community
  • 1
  • 1
chris
  • 6,653
  • 6
  • 41
  • 54