Question: I was visiting the site asos.com the other day. If you search 'tshirt' on their site the resulting URL is '<http://www.asos.com/search/tshirt?q=tshirt>'. Does anyone know which technique they use to make it seem that the live generate a page called 'tshirt' which basically takes any extension?

Also if you select a product the URL becomes something like: '<http://www.asos.com/ralph_lauren/polo/product.aspx>' I know they don't have a file and folder for every brand and item, so how is it possible for the browser to follow this url?

I'm not looking for any code, just a hint on what to google for more information.

Hope this doesn't sound too ignorant!

Many Ragards,  

Andreas

Answer: 
In most cases, this sort of functionality (often called clean URL's, user-friendly URL's, or spider-friendly URL's), is achieved through server-side rewrites. To point all requests of a specific known structure to a single backend script for processing.

Now these specific URL's you mention are not, in my opinion, the best examples of clean URL's. I will give you an example however of how such a clean URL might be achieved using Apache mod\_rewrite (since Apache is so popular).

Take for example a URL like `http://somedomain.com/product/ralph_lauren/polo`

You might be able to do something like this in mod\_rewrite

```
RewriteEngine On
RewriteRule /?product/(.*)/(.*) /product.php?cat=$1&subcat=$2 [L]

```

This would silently (to the end user) redirect the incoming request for any URL's of the structure `/product/*/*` to a script called `/product.php`, passing the second and third parts of the URL as `cat` and `subcat` parameters to be evaluated by the script.
I'm not sure I understand what you are asking, but in the example you cited it's using a query string which is everything after the '?' in the URL.

On the backend server it uses the variables passed in the query string to determine what to return back to you.