Apache Useful Links Category

preg_match + $_server

In: Apache Useful Links, PHP

<?php
$geturl=$_SERVER['HTTP_HOST'];
if(preg_match(”/xxx.com/i”, $geturl))
{
$geturl=preg_replace(’#aaa.com#is’,”,$geturl);
?>
<meta http-equiv=’refresh’ content=’0; url=<?php echo $geturl;?>’>
< ?php
exit;
}
?>

Mod Rewrite Generator

In: Apache Useful Links

Please refer to http://www.thetoptopsites.com/tools/modrgen/

mod rewrite

In: Apache Useful Links

mod_rewrite is just possibly one of the most useful Apache modules and features. The ability to rewrite requests internally as well as externally is extremely powerful.
.htaccess rewrite examples should begin with:

Require the www
Require no www
Check for a key in QUERY_STRING
Removes the QUERY_STRING from the URL
Fix for infinite loops
Redirect .php files to .html files (SEO [...]