1

I'm going to do a website with AJAX.

At the moment i change my main content with '#':

e.g. example.com/#home --> example.com/#site1 I managed it to change the content at the moment the hashtag changes.

But now i want to use a method i know from google. example.com/home/ --> example.com/site1/

I know so far how to change the URL without reloding the page. (Modify the URL without reloading the page) My problem is if the user reloads the site or uses the navigation buttons, he will land on example.com/site1/index.php and not on example.com/index.php.

BUT it is important that the data (site1) is send to the script.

I hope you can understand my problem.

Community
  • 1
  • 1
Sebastian Schneider
  • 4,896
  • 3
  • 20
  • 47

1 Answers1

1

You need something on the server side (.htaccess for example) to return your index.php no matter what the url is.

See here for a possible solution: https://stackoverflow.com/a/8392502/1030527

Community
  • 1
  • 1
bernie
  • 9,820
  • 5
  • 62
  • 92