web2000 Posted May 11, 2007 Share Posted May 11, 2007 Hello, I have an advanced system which has folders with up to 8 folders deep : http://192.168.0.1/webserver/dddf/dfdsfdf/sdfsdfsd/fdsfds/fsdfsdfdf/dfdsf/dfdf/sdfdf/ and it is very untidy for the user. How can i replace the url not actually go to that url but just replace it with http://192.168.0.1/webserver/ Thank you Quote Link to comment https://forums.phpfreaks.com/topic/50953-replace-url/ Share on other sites More sharing options...
StormTheGates Posted May 11, 2007 Share Posted May 11, 2007 One way would be to have a frame on something like sliced.php, and then have everything load within that frame. Make it 100% width and height and invisible or something. Quote Link to comment https://forums.phpfreaks.com/topic/50953-replace-url/#findComment-250679 Share on other sites More sharing options...
web2000 Posted May 11, 2007 Author Share Posted May 11, 2007 Thanks for that, can you give me an example on how this work with frames? Sorry im only dreamweaver havent used frames before Quote Link to comment https://forums.phpfreaks.com/topic/50953-replace-url/#findComment-250682 Share on other sites More sharing options...
mpharo Posted May 11, 2007 Share Posted May 11, 2007 You need to set up an alias for that folder on the webserver...which if the folders are dynamic this will not work.... If they are dynamic you could use the scandir() function to get a directory listing... then you would put the folder that the user wants to goto into a variable and when they go there you just send them there via header() function.... example: directory: test sub-dir: stest1 sub-dir: stest2 $dir = scandir('/usr/local/www/apache22/data/test'); $i_total=count($dir); for ($i=0; $i<$i_total; $i++) { echo "<a href=\"http://192.169.0.1/$dir[$i]/\">" . $dir[$i] . "</a><br>"; } will give you an output of: stest1 stest2 as links and then they will take you to that directory... im not sure if this is what your looking for but you can also use the header() function to do something similar by populating the directory into a variable then use the header() function to send them to that folder. Quote Link to comment https://forums.phpfreaks.com/topic/50953-replace-url/#findComment-250686 Share on other sites More sharing options...
raydawg Posted May 11, 2007 Share Posted May 11, 2007 or you can use a .htaccess file to rewrite the url Quote Link to comment https://forums.phpfreaks.com/topic/50953-replace-url/#findComment-250908 Share on other sites More sharing options...
web2000 Posted May 11, 2007 Author Share Posted May 11, 2007 Cool, how? thank you Quote Link to comment https://forums.phpfreaks.com/topic/50953-replace-url/#findComment-250925 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.