Re: Best Practice to Create Dynamic URL's- With Username

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A Big Thanks to all of you.

Question I was Asked by Andrea- "mod_reqrite or .htaccess is the answer, but
I wonder why you choose /user/username rather than just /username a la
twitter."

I will be using many other aspects of my users something like
"/projects/username/"; "/gallery/username/".

OK Ashley, Tommy and Ralph-

100% correct that mod_rewrite will be used.

I am a bit sticky that my URL will be-
"http://www.abcnetwork/user/*Ashley*<http://www.abcnetwork/user/username>".

So will I get $_GET["user"] with value as "*Ashley*" or *Tommy* in my
script?

<http://www.abcnetwork/userProfile.php?user=username>So what exactly will be
the ".htaccess" rule for above?


Thanks,

Gaurav Kumar
OSWebstudio.Com



On Mon, Sep 21, 2009 at 1:26 PM, Ashley Sheridan
<ash@xxxxxxxxxxxxxxxxxxxx>wrote:

> On Mon, 2009-09-21 at 13:24 +0530, Gaurav Kumar wrote:
> > Hi All,
> >
> > I am creating a social networking website. I want that every user should
> > have there own profile page with a static URL like-
> >
> > http://www.abcnetwork/user/username
> >
> > Where username will be dynamic userid or something else.
> >
> > This is something very similar to www.youtube.com/user/kumargauravmail(this
> > is my profile page).
> >
> > So what should be the best practice to create such DYNAMIC URL's OR what
> > kind of methodology youtube is following?
> >
> > Thanks in Advance.
> >
> > Gaurav Kumar
> > OSWebstudio.com
>
> If you're working on an Apache server, your best bet is to look at
> mod_rewrite. You can write a simple rule to match against these sorts of
> URL formats, so that to your visitors it appears as if the actual path
> exists, but internally it can get translated to something like
> http://www.abcnetwork.com/profile.php?id=username
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux