When typing in the address bar index.php it still does not redirect to index without .php . I tried on the test line - everything works fine. Where is the mistake?
$pattern = "/\.(php|html|asp|aspx|phtml|shtml)/i"; if(preg_match($pattern, $_SERVER['REQUEST_URI'])){ $currentPage = $_SERVER['REQUEST_URI']; $shortCut = preg_replace($pattern, "", $shortCut); header("Location:".$shortCut); }
Location:there is no space, and afterheader("Location:".$shortCut);noexit();- Visman$currentPageand$shortCut? - br3tOptions +MultiViewsin the server config and if the user types.phpat the end of the file name, he will still be sent to the same page without.php- Eugen Eray