Hello! There is a site where in the address bar you can enter instead of one / two or more, and the pages will still open (example: test//home///page ). It is necessary to do so that if the address bar contains two or more / in a row, refer to the same page only with normal slashes (for example: test/home/page ). I tried to do this:
$pos = strpos($_SERVER['REQUEST_URI'], '//'); if($pos != '') { $link = str_replace ( '//', '/', $_SERVER['REQUEST_URI']); header('Location: ' . $link .''); } For some reason, it does not take into account the slashes at the very beginning of the address (for example: test//home/page ).
strposdoes not see the first entry - r.mcreal