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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.