Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 1.14 KB

htaccess.md

File metadata and controls

27 lines (22 loc) · 1.14 KB

Re-routing to index

Explanation

Basically, we're trying to push all the requests made to the server to a single root file, so a request made to /home.php will be directed to the root file of our choice....usually index.php.

This complex sounding feature can be achieved by simply adding a .htaccess file to the root of our project directory.

The HTACCESS file

This is a basic example of an htaccess file. It basically re-routes all requests to our index.php file.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

Save as .htaccess in your the same directory as your "root file"



Your first leaf app Routing Request Response Using a database


Built with ❤ by Mychi Darko