criticalbh / PHP-Simple-Routing-System

This little script provides you a way to have pretty URLs in your php web site. If you just want to have routes but you do not want to bother with massive php frameworks, you could find this useful
5 stars 6 forks source link

Routing issue #2

Open hfryan opened 6 years ago

hfryan commented 6 years ago

I was not able to get this to work straight from the zip file. I had kept getting the default error handler message when clicking on the 'Home' link. Looking further into the issue, I found that in engine.php on line 32 you have if($url == $route['link']), my $url kept coming back with /home/ and the $route['link'] was coming back as home.

I modified this in my version to: if(str_replace('/', '', $url) == $route['link']){

hanadi92 commented 5 years ago

but then all URLs will be stripped of their forward slashes (no matter how many they are), and will never equal to the $route['link'] which has the normal forward slashes.

Example: $url = lives/home stripped $url = liveshome $route['link'] = lives/home ...

burakalac4 commented 4 years ago

Router using 404 page how make?