Jump to content

Archived

This topic is now archived and is closed to further replies.

gtridez

Need help redirecting a non-existent directory...

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


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

Share this post


Link to post
Share on other sites
[!--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 on
RewriteRule ^user$ userProfile.php [NC,L][/code]

Share this post


Link to post
Share on other sites
[!--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 on
RewriteRule ^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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.