php - Loading a single file for all pages -



php - Loading a single file for all pages -

i running apache webserver, goal have loader (in php) gets loaded urls. illustration if head website.com/test/, website.com/page.php or website.com/ load website.com/index.php

how can accomplish this?

you can create .htaccess file rewrite url not file or directory on server , redirect index.php file. additionally can have original url attached query string can work in script if need be.

<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php?$1 [l,qsa] </ifmodule>

php apache

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -