Skip to content

Instantly share code, notes, and snippets.

@tkon99
Created May 8, 2014 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkon99/0bf81c3fba5c90963c95 to your computer and use it in GitHub Desktop.
Save tkon99/0bf81c3fba5c90963c95 to your computer and use it in GitHub Desktop.
Rewrite top level url to index.php
<?php
//header begin
/*
* Force url rewrite (www.website.com -> www.website.com/index.php)
*/
$req = $_SERVER['REQUEST_URI'];
if (strpos($req,"index.php") !== false) {//if true (good, no rewrite needed)
}else{ //redirect if false
header('Location: index.php');
}
//end header
?>
@tkon99
Copy link
Author

tkon99 commented May 8, 2014

This will basically force the browser to update index.php instead of using it's cache to load the top level website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment