Treat directory as request for a PHP file -



Treat directory as request for a PHP file -

this question related php

how create request directory on server (that doesn't exist) become treated variable.. example:

domain.com/username request domain.com/profile.php?user=username

is possible? or how youtube/twitter/facebook it?

jeff, called "friendly url" , done url rewrite. recommend reading documentation: http://httpd.apache.org/docs/current/mod/mod_rewrite.html.

if not familiar regular expressions shoud read http://www.php.net/manual/en/reference.pcre.pattern.syntax.php

if using apache web server create .htaccess file on directory next content accomplish this

rewriteengine on rewriterule ^[a-za-z0-9_.-]+$ profile.php?user=$1 [l]

php directory

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -