--- Gangadhara Prasad <[EMAIL PROTECTED]> wrote: > How to write URL Rewritten. > > I need to convert this url > http://www.invitationnetwork.com/beta/invitationking/?a_aid=eadea935&a_bid=2115b7f4 > to > > http://www.invitationnetwork.com/beta/test > > Can you please help me. > > Thanks, > Gangadhar.
This is not really a PHP question if InvitationNetwork.com is your domain. If you are expecting to receive the first domain and want it to be displayed as the second, the appropriate tool is the Apache module called mod_rewrite which uses regular expressions to alter URLs. If you have the first URL as a string and wish to pick out the parts to assemble the second, this can be done with something like this. Note that any change in the URL format will cause the RegEx to fail and no substitution will occur. $in = "http://www.invitationnetwork.com/beta/invitationking/?a_aid=eadea935&a_bid=2115b7f4"; $reg = "m|(http://.+?/beta/).*|"; $out = (preg_match($reg, $in, $matches)) ? $matches[1] . "test" : $in; Finally, please don't post a question to several groups. Those of us who don't subscribe to the other groups have no idea whether your question was answered in one of them and don't get the benefit of learning from the solution. Ask the question in one group at a time. James
