ttocskcaj Posted May 23, 2011 Share Posted May 23, 2011 I want to rewrite an address like /$1/$2 to something like $1.php?q=$2 Any ideas how I can do this? Thanks Link to comment https://forums.phpfreaks.com/topic/237192-pass-two-variables/ Share on other sites More sharing options...
sunfighter Posted May 23, 2011 Share Posted May 23, 2011 Probably need to exact url, but try this: $myarray = explode('/', 'url'); $newUrl = $myarray[1] . '.php?q=' . $myarray[2]; If this is not what you need give us the real url. Link to comment https://forums.phpfreaks.com/topic/237192-pass-two-variables/#findComment-1219096 Share on other sites More sharing options...
Maq Posted May 23, 2011 Share Posted May 23, 2011 I think he wants to do this in the .htaccess. Link to comment https://forums.phpfreaks.com/topic/237192-pass-two-variables/#findComment-1219098 Share on other sites More sharing options...
ttocskcaj Posted May 24, 2011 Author Share Posted May 24, 2011 Yea, I want to do it in htaccess, using mod_rewrite Link to comment https://forums.phpfreaks.com/topic/237192-pass-two-variables/#findComment-1219456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.