1
I want to convert all the dynamic urls ( which look dynamic in nature ) to static urls
for ex:
http://www.domainname.com/modules/news/index.php?page=122to
http://www.domainname.com/modules/news/index.php/page/122I just got this script from somewebsite. But I could not understand how this can solve my issue If I paste it in header.php
can someone help me this. Thanks for reading.
// Just copy and past this code in your PHP
target page header and use all the variables in
$HTTP_GET_VARS.
// Easy to use and you have no need to edit or
change your rest of the PHP page.
// I have replaced the '/' of source URL
variables with '|' sign.
// for example
http://www.domain.com/search.php/mfg/S|W|Inter|Intra|Extranet/P_id/1009
// mfg = S|W|Inter|Intra|Extranet
// P_id = 1009
// for further referance or any help Imran Khalid
imranlink@hotmail.comif(isset($PATH_INFO)) {
$vardata = explode('/', $PATH_INFO);
$num_param = count($vardata);
if($num_param % 2 == 0) {
$vardata[] = '';
$num_param++;
}
for($i = 1; $i < $num_param; $i += 2) {
$key = $vardata[$i];
$vardata[$i] = $vardata[$i+1];
$HTTP_GET_VARS[$key] = str_replace
('|', '/', $vardata[$i]);
}
}
?>