![]() |
domain/user/usename
some website like youtube and myspace they provide to every user a link like domain/username. Do they create for each users a directory ?
|
Its called mod_rewrite. You use a .htaccess file to rewrite the url. For example:
The raw php URL will look like: Code:
http://example.com/?user=ScottymeukCode:
RewriteEngine onIt will turn out like: Code:
http://example.com/user/ScottymeukPlease note: I have not tested this code. |
You should write a tutorial.
For all the mod rewrite tutorials I have read that is the first one that I could clearly follow. Going to have to go change my rewrite rules. |
Quote:
|
What are your current rewrite rules, Krik, out of curiosity?
|
You may also want to change the mod_rewrite code I gave you a bit for validation as at the moment any characters can be used in the URL but you only want to allow alphanumeric chars.
|
Here is one good tutorial for you:
http://www.addedbytes.com/apache/url...for-beginners/ |
| All times are GMT. The time now is 02:11 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0