.htaccess - PHP: Custom Designed URL -


im trying send users custom url's based on profile information. instead of sending user www.website.com/profile/john.doe want send them www.website.com/john.doe - when try remove "profile" portion of url. error saying

the john.doe_controller.php file not found. 

unless im understanding wrong, dont want create new controller file every user. there .htaccess rule use this.

thanx in advance.

you can use following code in root/.htaccess :

rewriteengine on  rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.+)$ /profile/$1 [nc,l,qsa] 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -