Question: I'm currently in the process of setting my website, largely with php. Though this is my first time using it so I'm running into some problems.

I've got the basics of the site down. Registering, login-in, profile page e.t.c. However this is where I seem to have to make a decision about the site layout.

For instance. Currently a user's profile page has the URL of 

> 
> mysite.com/profile.php
> 
> 
> 

Ideally what I would like is for it to be is something along the lines of 

> 
> mysite.com/user/ChrisSalij
> 
> 
> 

From reading [this](https://stackoverflow.com/questions/115629/simplest-php-routing-framework) among other things I believe I need a Front Controller style site, though I'm not sure of this, nor where to start with implementing one.

Bearing in mind that I'm pretty new to php and the like, I would appreciate any helpful comments, and links, and constructive critiques. 

I'm defiantly will to learn so links to articles and explanations would be excellent. I usually do a fair amount of research on stuff like this. But I'm so new to it that I don't know where to start.

EDIT: I should also add that I'm planning on scaling this website up to the large scale. It's small to start with but there should be quite a few pages if my goals work out. So I'm willing to put the effort in now to get it set up right for the long term.
Thanks

Answer: 
Well, welcome to the world of PHP :)

First of all, a front controller is typically only 1 part of a larger framework known as a MVC (Model-View-Controller). Simply put, a front controller can be though of as the "index" page that all people go to when they come to your site. It handles initiating needed site things and then pulling and running what resouces are needed to handle the user request (typically through the URL, as you have given of mysite.com/user/...). This is an overly simple explanation. 

While not necessarily a hard thing to learn, I would recommend looking at a tutorial like [this](http://www.phpro.org/tutorials/Model-View-Controller-MVC.html) that explains the whole idea and basic implementation of a MVC. They call the front controller a "router" (that's another thing, there are more than 1 way to implement a MVC or it's variants and more than 1 name for the different parts). I don't think it is particularity hard to understand or grasp. Most modern MVC frameworks do implement Object Oriented Programming practices. For a good set of video screencast on PHP (including some basic OOP skills), take a look [here](http://net.tutsplus.com/videos/screencasts/diving-into-php-video-series/).

Lastly, if this is your first big use of PHP and want to implement something like MVC, you might check out something like [CakePHP](http://cakephp.org/) or [CodeIgniter](http://codeigniter.com/). Great frameworks that have good documentation and has done alot of hard work for you. Good luck
Have a look at Apache's mod\_rewrite. Something as simple as the code below would do the trick.
I wouldn't make a decision about architecture, if it could be a case that learning to use mod\_rewrite would solve your problem. More than likely it will be useful in the future for you anyway.

```
RewriteRule ^user/(.*)/$    profile.php?username=$1 [PT]

```

* [A Beginner's Guide to URL Rewriting](http://articles.sitepoint.com/article/guide-url-rewriting)

Edit: The Front Controller pattern does not scale. For example if one part of your application is more heavily used than others, if you are using a front controller you can not scale that particular request.