0

How passing of url parameters works in facebook, twitter , youtube or other similar sites .

eg:

facebook http://www.facebook.com/stackoverflowpage

twitter: http://twitter.com/StackOverflow

you tube: http://www.youtube.com/user/BBCWorldwide

where bold ones are parameters( i believe those are parameters)

What i have seen in most websites is like this,

http://www.website.com/index.php?id=stackoverflow

then how those above websties is passing parameters in different method,how they are doing this?. Or whether when a new user is joined in those website a new file is created in their server.

eg: http://www.facebook.com/stackoverflowpage http://www.facebook.com/stackoverflowpage.php(or .aspx whatever methods)

1 Answer 1

2

This is usually done by URL rewriting on ther server side. For example using .htaccess. A typical situation is: when a request of the form http://server.com/x/y comes in, it is rewritten as http://server.com/index.php?param1=x&param2=y and then passed on to the request processor (say, PHP).

Ref: http://en.wikipedia.org/wiki/Rewrite_engine

Sign up to request clarification or add additional context in comments.

4 Comments

no, the above is only an example. url can be rewritten in a lot of ways depending on your app and/seo/url strategy
i am using htaccess in my websites. i am passing like this website.com/index.php?id=stackoverflow -> website.com/Home?id=stackoverlfow ..but how how i can convert this url to website.com/stackoverflow using htacess
in your case, it would be: RewriteRule ^stackoverflow$ index.php?id=stackoverflow - this will rewrite /stackoverflow to /index.php?id=stackoverflow

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.