Forum Moderators: coopster
here is the code,,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]);
}
}
?>
thanks
i want to change these URLs with this function to SEO friendly URLs on fly e.g
www.domain.com/index.php/value1/value2 OR
www.domain.com/value1/value2
so please help me if you can give me an example that how can i use it, thanks for your time
Try the mod_rewrite generator:
dc
it gives me
Options +FollowSymLinks
RewriteEngine on
RewriteRule index/(.*)/(.*)/(.*)/(.*)/$ /nnmoj/index.php?$1=$2&$3=$4
for URLs like (http://localhost/index/linkname/xbox/maincat/games/)
first of all i dont want URL like the above i want somethig like (http://localhost/index/xbox/games/)
and secondly its not working when i write the URL (http://localhost/index/linkname/xbox/maincat/games/) it gives error like page not found.....any idea?
I tried it with:
[domain.com...]
Which will output a mod re-write of:
[domain.com...]
The mod_rewrite rule is:
Options +FollowSymLinks
RewriteEngine on
RewriteRule index/(.*)/(.*)/(.*)/(.*)/$ /index.php?$1=$2&$3=$4
dc
Options +FollowSymLinks
RewriteEngine on
RewriteRule moj-(.*)-(.*)\.htm$ /nnmoj/index.php?linkname=$1&maincat=$2
i go it by using Rewrite pattern generator tool on this site it has some thing in the end of $2 i removed that and now its working very fine with URLs like [localhost...]
where MOJ is the page name that i added
i have been working over this mod rewrite for the last one and half month and tried all forums, to see it working is a dream comes true feeling :) thank u very much fellows this forum and its memebers are just awesome thanks again for so much help