I'm making a blog site and instead of the users blogs being called /blog?display=username I would like it to just be a sub domain such as mysite.com/username
How would I be able to make the first URL look like the second URL?
|
I'm making a blog site and instead of the users blogs being called /blog?display=username I would like it to just be a sub domain such as mysite.com/username How would I be able to make the first URL look like the second URL? |
|||
|
Place this in your .htaccess file:
This will redirect each URL which do not corresponds to an existing file ( |
|||||||||||||
|
|
You are probably looking for mod_rewrite. It's easy, just put this in your
|
|||
|
|
|
You can use the PATH_INFO variable. More here: http://httpd.apache.org/docs/2.0/mod/core.html Previous answer (using Request.PathInfo) was tarted at asp.net -- thanks for pointing that out. |
|||||
|
|
username.mysite.com. – Álvaro G. Vicario Jul 23 '11 at 16:33