Question: I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php
I have two webpage link together like when a button is press it leads to the second webpage. my problem is that I'm trying to get a clean url with the .php
removed. now my url looks like this
http://localhost/ecommer%20flower%20shop/flowers/list.php
and the second webpage
http://localhost/ecommer%20flower%20shop/flowers/about.php
.
i want my url to be like
http://localhost/ecommer
flower shop/
http://localhost/ecommer
flower shop/about
the code i have written for this in index.php
<?php if ($_SERVER['REQUEST_URI'] == '/') { # code... return include_once './flowers/list.php'; } if ($_SERVER['REQUEST_URI'] == '/about') { # code... return include_once './flowers/about.php'; }
but this is not working and gives blank page, i don't know my mistake or what to do to fix code