javascript - How do I ignore all pathNames and load my index.php at the root of my site? -
when user clicks nav link on web site loads page content window on current page javascript.
i utilize html 5 manipulate url , create history entry. url left looks 1 in question (https://somedomain.com/questions).
the problem if click refresh or send link gets 404 error because going pathname /questions , looking index.
in case loading (pages/questions.php).
is there way create domain ignores pathnames or can utilize location.pathname page loading main index.php @ root of domain...
here current .htaccess code
#default index page directoryindex index.php #php code in html file addtype cgi-script .php .htm .html .phtml rewriterule ^/.*$ /index.php
it needs configured @ web server (e.g. apache, iis, etc.), rewriting every url index.php
.
for example, in apache done using rewriterules in .htaccess
, case - send request file index.php:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php </ifmodule>
if it's indeed apache, can check more comprehensive solution @ wordpress' .htaccess
.
javascript php jquery html5
No comments:
Post a Comment