There is a one-page project, everything is loaded via ajax. How to make the address was

http://mysite.com/'нужная страница' 

So that index.php is always loading and, based on the end of the address, the ajax page is built?

    2 answers 2

    Perhaps it would be better to use the HTML 5 History API. Follow this link , there after the manual in English there will be a manual in Russian, as well as a demo from the author , where you can download the source of the site.

    PS When I understood, this manual helped me a lot with this case. Good luck;)

    • and how to make sure that index.php is always loaded ahserg
    • in what sense was it loaded? I don't understand what you want) - cho0pa
    • the site is made up from one page and everything else is loaded ajax and the url is changed so that these url works. It is necessary that the index.php is always loaded and the url is used to build the javascript site - ahserg
    • so what's the problem? - thunder

    Dig in the direction of history Hash .

    In VC so:

     var setLoc = function (loc) { //curLoc = fixEncode(loc.replace(/#(\/|!)?/, '')); curLoc = fixEncode(loc); var l = (location.toString().match(/#(.*)/) || {})[1] || ''; if (!l && vk.al > 1) { l = (location.pathname || '') + (location.search || ''); } l = fixEncode(l); if (l.replace(/^(\/|!)/, '') != curLoc) { if (vk.al == 3) { try { history.pushState({}, '', '/' + curLoc); return; } catch (e) {} } window.chHashFlag = true; location.hash = '#' + vk.navPrefix + curLoc; if (withFrame && getLoc() != curLoc) { setFrameContent(curLoc); } } } 
    • thanks))) - ahserg 2:49
    • The plugin is good, but already outdated. - Deonis