htaccess_redirect.php
<?php
//================================================================================================
// CREATE LINK TO SPECIFIC PAGE USING "WWW.MYDOMAIN.COM/USERNAME" BY WRITING TO .HTACCESS
/*
Writes a redirect the the .htaccess file (held in the root folder) that redirects a short
URL to a longer one. An example .htaccess file is provided in this folder.
E.G
www.mydomain.com/username
$redirector_handle = "username";
$domain = "http://www.mydomain.com";
$redirect_to = "galleries/summary.php?name=$auto_galleryID";
*/
function redirect($redirector_handle,$domain,$redirect_to){
$redirect = "redirect /$redirector_handle $domain/$redirect_to";
$tp = fopen(".htaccess", "a");
fwrite($tp, $redirect);
fwrite($tp, "\r\n");
fclose($tp);
}
// END CREATE LINK TO GALLERY SOMETHINGARTISTIC.COM/USERNAME BY WRITING TO .HTACCESS
//=================================================================================================
//=================================================================================================
?>
Paul's Code Library
Categories
HomeAJAX
classes
database_functions
date_functions
file_functions
googlevideo_and_youtube_api
htaccess
image_functions
string_functions