How to Mask Profile URLs like MySpace & Twitter?

How to Mask Profile URLs like MySpace & Twitter?

Page 1 of 1

3 Replies - 1722 Views - Last Post: 25 May 2009 - 03:44 AM

#1 ultimateweb   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 37
  • Joined: 24-May 09

How to Mask Profile URLs like MySpace & Twitter?

Post icon  Posted 24 May 2009 - 10:46 AM

I was wondering how i could "How to Mask Profile URLs like MySpace & Twitter?".
eg
http://www.namehere.com/profile.php?id="john" (before)

http://www.namehere.com/john

I doubt it would be a programming question so many it could be something to do with web development



Would anyone have an answer to this,because i've looked at many websites and have not seemed to gain any information!

Is This A Good Question/Topic? 0
  • +

Replies To: How to Mask Profile URLs like MySpace & Twitter?

#2 mocker   User is offline

  • D.I.C Regular
  • member icon

Reputation: 51
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: How to Mask Profile URLs like MySpace & Twitter?

Posted 24 May 2009 - 03:39 PM

On an apache server, you can use mod_rewrite to make custom urls like that. You'd put a rewrite rule in your root directory to take the namehere.com/x and redirect it to profile.php?id=x . The redirect is only for the webserver so the user still see's the pretty namehere.com/x .
Was This Post Helpful? 0
  • +
  • -

#3 Wimpy   User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: How to Mask Profile URLs like MySpace & Twitter?

Posted 24 May 2009 - 04:40 PM

In asp.net you would have to do some configuration in the web.config-file and such!
MSDN Link
Was This Post Helpful? 0
  • +
  • -

#4 dsherohman   User is offline

  • Perl Parson
  • member icon

Reputation: 227
  • View blog
  • Posts: 654
  • Joined: 29-March 09

Re: How to Mask Profile URLs like MySpace & Twitter?

Posted 25 May 2009 - 03:44 AM

View Postmocker, on 24 May, 2009 - 10:39 PM, said:

On an apache server, you can use mod_rewrite to make custom urls like that. You'd put a rewrite rule in your root directory to take the namehere.com/x and redirect it to profile.php?id=x . The redirect is only for the webserver so the user still see's the pretty namehere.com/x .

This actually does not require mod_rewrite, although that's a very common way to do it. With the correct apache configuration and a language that supports it, CGI-type languages (including, I'm fairly sure, PHP) can get the /x passed to them in the PATH_INFO environment setting. If you're writing the code as an apache module rather than an outside program, then this is pretty much the default way of doing it - your module just registers with apache as handling everything for /myapp/ and then /myapp/x/y/z will be automatically passed to it with /x/y/z as a parameter.

This post has been edited by dsherohman: 25 May 2009 - 03:45 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1