What means are processed url vKontakte I am interested in how the server and pages work when url for example http://vkontakte.ru/id 27063599
2 answers
//.htaccess RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z0-9]+)$ index.php?get=$1 [L] где http://vkontakte.ru/username или http://vkontakte.ru/id123456789 на самом деле работает как http://vkontakte.ru/index.php?get=username или http://vkontakte.ru/index.php?get=123456789 Рвемвся в БД по запросу WHERE `user_unic` = '".$_GET['get']."' I hope the principle is explained normally)
- oneAnd you can link where this is said in more detail, please. - Vitaly Zaslavsky
|
$ _GET options. through them, most likely, well, and there you receive and process them.
- There are no these GET signs like? = or & Here in some other way If it were processed through error 404 and that file, then there would be no such thing ( vkontakte.ru/sdffdsfd ) - Vitaly Zaslavsky
- And who said that it is impossible to pass GET parameters, so why advertise how parameters are transferred to you? site.com/user/shrek site.com/page/about This is all configurable via .htaccess is so RewriteCond% {REQUEST_FILENAME}! -f RewriteCond% {REQUEST_FILENAME}! -d RewriteRule. index.php - Artem
- you can even without htaccess =) Parse the value of $ _SERVER ['REQUEST_URI'] and go =) - Zowie
|