Jump to content


Photo

Need help redirecting a non-existent directory...


  • Please log in to reply
5 replies to this topic

#1 gtridez

gtridez
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 24 May 2006 - 06:01 PM

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

#2 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 24 May 2006 - 08:28 PM

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.

#3 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 25 May 2006 - 10:08 PM

If your server uses Apache, use mod_rewrite (search for it on google) in your .htaccess file. Nothing to do with php.

NoGray.com


#4 burhankhan

burhankhan
  • Members
  • PipPipPip
  • Advanced Member
  • 43 posts

Posted 26 May 2006 - 10:44 AM

[!--quoteo(post=376761:date=May 24 2006, 11:01 PM:name=gtridez)--][div class=\'quotetop\']QUOTE(gtridez @ May 24 2006, 11:01 PM) View Post[/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:
RewriteEngine on
RewriteRule ^user$ userProfile.php [NC,L]


#5 gtridez

gtridez
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 26 May 2006 - 07:46 PM

[!--quoteo(post=377271:date=May 26 2006, 06:44 AM:name=burhankhan)--][div class=\'quotetop\']QUOTE(burhankhan @ May 26 2006, 06:44 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
user appache mod_rewrite module.....

create an .htaccess file at your root directory, and put this code in it:
RewriteEngine on
RewriteRule ^user$ userProfile.php [NC,L]
[/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!


#6 samsbc12

samsbc12
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 26 May 2006 - 07:59 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users