1
konaafob
trying to convert the dynamic URL's
  • 2006/5/24 15:53

  • konaafob

  • Just popping in

  • Posts: 57

  • Since: 2005/1/10


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=122
to
http://www.domainname.com/modules/news/index.php/page/122

I 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|Int

er|Intra|Extranet/P_id/1009
// mfg = S|W|Inter|Intra|Extranet
// P_id = 1009
// for further referance or any help Imran Khalid
imranlink@hotmail.com

if(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]);
}
}
?>

2
marcionline
Re: trying to convert the dynamic URLs


Login

Who's Online

302 user(s) are online (237 user(s) are browsing Support Forums)


Members: 0


Guests: 302


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits