Skip to content

Instantly share code, notes, and snippets.

@tkon99
Created May 8, 2014 18:04
Show Gist options
  • Select an option

  • Save tkon99/0bf81c3fba5c90963c95 to your computer and use it in GitHub Desktop.

Select an option

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

tkon99 commented May 8, 2014

Copy link
Copy Markdown
Author

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