agha.faisal Posted May 19, 2008 Share Posted May 19, 2008 hi, suppose there is some site url www.xyz.com if any user type in the address bar like this www.xyz.com/abc www.xyz.com/def www.xyz.com/ghi remember there are no directories like abc,def,ghi i want to know only the text after www.xyz.com i want to get the url address in php or using javasript. thanks Quote Link to comment https://forums.phpfreaks.com/topic/106375-have-u-the-power-in-php-then-try-to-do-this-little-challenge/ Share on other sites More sharing options...
MadTechie Posted May 19, 2008 Share Posted May 19, 2008 your need to write a mod-rewrite (see apache .htaccess file) this can then point the abc to a get ie ?param=$1 $_GET['param'] would be abc example (untested) RewriteEngine on RewriteRule ^index.php/(.*) ?index.php?param=$1 Quote Link to comment https://forums.phpfreaks.com/topic/106375-have-u-the-power-in-php-then-try-to-do-this-little-challenge/#findComment-545285 Share on other sites More sharing options...
Caesar Posted May 19, 2008 Share Posted May 19, 2008 My suggestion, use .htaccess/Apache rewrites. Quote Link to comment https://forums.phpfreaks.com/topic/106375-have-u-the-power-in-php-then-try-to-do-this-little-challenge/#findComment-545288 Share on other sites More sharing options...
MadTechie Posted May 19, 2008 Share Posted May 19, 2008 Which is exactly the same as mine!! Quote Link to comment https://forums.phpfreaks.com/topic/106375-have-u-the-power-in-php-then-try-to-do-this-little-challenge/#findComment-545289 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.