Re: Best Practice to Create Dynamic URL's- With Username
| From: | Gaurav Kumar | Date: | Mon, 21 Sep 2009 09:27:45 +0000 |
| Subject: | Re: Best Practice to Create Dynamic URL's- With Username | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298217@lists.php.net to get a copy of this message | ||
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@ashleysheridan.co.uk>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
>
>
>
>