Advertisement
Prion84

Untitled

Mar 14th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. $uri = preg_replace("/\?.*/i",'', $_SERVER['REQUEST_URI']);
  2.  
  3. if (strlen($uri)>1) {
  4. if (rtrim($uri,'/')."/"!=$uri) {
  5. header("HTTP/1.1 301 Moved Permanently");
  6. header('Location: http://'.$_SERVER['SERVER_NAME'].$uri.'/');
  7. exit();
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement