gtridez Posted May 24, 2006 Share Posted May 24, 2006 Hey,I would like to know if anyone knows how to make a non-existent directory redirectoy redirect to ...lets say a profile...for example like how it is done on myspace.com ....where they hape [a href=\"http://www.myspace.com/user\" target=\"_blank\"]http://www.myspace.com/user[/a] and that then redirects to the users profile...any help would be greatly appreciated...thanks alot Quote Link to comment https://forums.phpfreaks.com/topic/10377-need-help-redirecting-a-non-existent-directory/ Share on other sites More sharing options...
448191 Posted May 24, 2006 Share Posted May 24, 2006 As far as know, what you believe to be used on myspace can't be done (if I understand correctly). It's simply because a webserver doesn't "make up" directories. An index file can redirect, or maybe they use url masking, but generally what you ask can't be done. Quote Link to comment https://forums.phpfreaks.com/topic/10377-need-help-redirecting-a-non-existent-directory/#findComment-38697 Share on other sites More sharing options...
nogray Posted May 25, 2006 Share Posted May 25, 2006 If your server uses Apache, use mod_rewrite (search for it on google) in your .htaccess file. Nothing to do with php. Quote Link to comment https://forums.phpfreaks.com/topic/10377-need-help-redirecting-a-non-existent-directory/#findComment-39033 Share on other sites More sharing options...
burhankhan Posted May 26, 2006 Share Posted May 26, 2006 [!--quoteo(post=376761:date=May 24 2006, 11:01 PM:name=gtridez)--][div class=\'quotetop\']QUOTE(gtridez @ May 24 2006, 11:01 PM) [snapback]376761[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hey,I would like to know if anyone knows how to make a non-existent directory redirectoy redirect to ...lets say a profile...for example like how it is done on myspace.com ....where they hape [a href=\"http://www.myspace.com/user\" target=\"_blank\"]http://www.myspace.com/user[/a] and that then redirects to the users profile...any help would be greatly appreciated...thanks alot[/quote]user appache mod_rewrite module.....create an .htaccess file at your root directory, and put this code in it:[code]RewriteEngine onRewriteRule ^user$ userProfile.php [NC,L][/code] Quote Link to comment https://forums.phpfreaks.com/topic/10377-need-help-redirecting-a-non-existent-directory/#findComment-39154 Share on other sites More sharing options...
gtridez Posted May 26, 2006 Author Share Posted May 26, 2006 [!--quoteo(post=377271:date=May 26 2006, 06:44 AM:name=burhankhan)--][div class=\'quotetop\']QUOTE(burhankhan @ May 26 2006, 06:44 AM) [snapback]377271[/snapback][/div][div class=\'quotemain\'][!--quotec--]user appache mod_rewrite module.....create an .htaccess file at your root directory, and put this code in it:[code]RewriteEngine onRewriteRule ^user$ userProfile.php [NC,L][/code][/quote]hey..thanx...yes i was informed to use the mod_rewrite rule and i have already found a solution....similar to yours...thanks alot tho! Quote Link to comment https://forums.phpfreaks.com/topic/10377-need-help-redirecting-a-non-existent-directory/#findComment-39270 Share on other sites More sharing options...
samsbc12 Posted May 26, 2006 Share Posted May 26, 2006 I am not sure if i get you but you could edit your 404 page so taht if the page is not found then you have the 404 page contain<meta http-equiv="refresh" content="2;URL=http://www.pagetogoto.com">and where content is the number of second to wait for the redirect 0 for instant let me know if this helps Quote Link to comment https://forums.phpfreaks.com/topic/10377-need-help-redirecting-a-non-existent-directory/#findComment-39272 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.