.htaccess URL Rewrite
Gives you code to put in your .htaccess file that will convert your dynamic URLs into search engine friendly pages, either htm or html. Dynamic URLs have a ? near the end of them."; $title = ".htaccess URL Rewrite"; include("header.php"); $_REQUEST['ex'] = @$_REQUEST['ex'] ? $_REQUEST['ex'] : ".html"; $_REQUEST['sep'] = @$_REQUEST['sep'] ? $_REQUEST['sep'] : "-"; ?>
Enter Dynamic URL:
Extension:
Separator:
 

Insert this into your .htaccess file

"; $content = "Options +FollowSymLinks\nRewriteEngine on\n"; $url = preg_replace("#^.*?\\?#","",$_REQUEST['url']); $url = explode("&",$url); $sStr = array(); $dStr = array(); foreach($url as $k=>$v) { $t = explode("=",$v); $sStr[] = $t[0].$_REQUEST['sep']."(.*)"; $dStr[] = $t[0]."=$".($k+1); } $sStr = $_REQUEST['sep'] . join($_REQUEST['sep'],$sStr); $dStr = join("&",$dStr); preg_match("#/?([^/]*?)\\?#",$_REQUEST['url'],$file); $file = $file[1]; $content .= "\nRewriteRule ".$sStr.(str_replace(".","\.",$_REQUEST['ex']))." $file?".$dStr; $str .= ""; echo $str; } ?>