Page 1 of 1

Redirect

Posted: Fri Jan 19, 2007 5:13 am
by bigdavemmu
Hello!

I have a small problem. MYSPACE is a good example of what I'm looking for. When I type in http://www.myspace.com/username I get redirected to the users profile page. I'm looking for the same result as this on my website.

Same as MYSPACE, I want the browser to be redirected to a page that shows the requested users profile but still has the correct URL in the address bar and not the URL of the actual page! I do not want to create a directory on the server for each user and then copy a profile page into each folder as this can become silly!

How do I do this?? I have no idea which is why I'm here. (Also, searching for anything to do with myspace and code brings up soooooo many irrelevant entries in search engines!)

Hope you guys and gals can help me!

**A distressed Irish Man!**

David! :>|

Posted: Fri Jan 19, 2007 6:14 am
by Grim...
PM'ing people for help is rather rude - we look at everything eventually.

Anyway, read this: http://truehacker.blogspot.com/2006/11/ ... p-and.html
And don't do it again :x

Posted: Fri Jan 19, 2007 6:21 am
by bigdavemmu
Sorry mate. I've been trying to sort this out for weeks and deadline is a couple of days away so I need to get it done ASAP.

I know it's not your problem, but please bare with me! Cheers.

Taken a look at the link you gave me. It's cool but what if I can't access the config file for Apache? Is there another way of doing this?

Posted: Fri Jan 19, 2007 6:24 am
by Grim...
Not to my knowledge, no.

Posted: Fri Jan 19, 2007 6:25 am
by bigdavemmu
By the way...

Let's say that you join my website with a username called "mod". To reach your profile page a random member of the public would type:

http://www.myurl.com/mod

Then the page would be served. However, there is not "mod" folder or page/file anywhere on the server. So I need to grab the "mod" from the URL requested and then use that in a page to serve the right profile page for the user. However, I also want to keep the http://www.myurl.com/mod in the address bar. So I don'#t want to move pages or I need a way to mask the URL.

I hope this clarifies a bit more!

Thanks

David

Posted: Fri Jan 19, 2007 8:52 am
by bigdavemmu
Problem solved. I used an .htaccess file to do apache mod_rewrite

Nice! Cheers anyway!

Posted: Fri Jan 19, 2007 1:00 pm
by Luke
bigdavemmu wrote:Problem solved. I used an .htaccess file to do apache mod_rewrite

Nice! Cheers anyway!
Uhh... isn't that the solution Grim suggested? :roll: