I am using cakephp framework 2.2.2 I want to create personalize URL for user if user enter username=pragneshthen they can access my site like http://pragnesh.mylocalhost.com same as in blinksale.comMy URL http://mylocalhost.com/test/users/front_homeI want to access it as http://test.mylocalhost.com/users/front_homeMy URL: http://mylocalhost.com/test/setting/pagescan be access as : http://test.mylocalhost.com/setting/pagesany URL: http://mylocalhost.com/test/xxxxx/xxxxxcan be access as : http://test.mylocalhost.com/xxxxx/xxxxxORURL http://mylocalhost.com/users/front_home?site=testI want to access it as http://test.mylocalhost.com/users/front_homeMy URL: http://mylocalhost.com/setting/pages?site=testcan be access as : http://test.mylocalhost.com/setting/pagesany URL: http://mylocalhost.com/xxxxx/xxxxx?site=testcan be access as : http://test.mylocalhost.com/xxxxx/xxxxxMy question may be duplicate of https://stackoverflow.com/questions/20328636/my-cakephp-2-2-site-not-working-on-subdomainbut there is no answer postedI have tried below code in \app\webroot.htaccesshttps://stackoverflow.com/questions/5649890/htaccess-subdomai-part-2RewriteCond %{QUERY_STRING} !^([^&]*&)*site=[^&]+RewriteCond %{HTTP_HOST} !^www\.mylocalhost.comRewriteCond %{HTTP_HOST} ([a-zA-Z0-9]+)\.mylocalhost.comRewriteRule ^([^\.]*).php$ /$1.php?user=%1 [QSA,L,R]https://stackoverflow.com/questions/25938781/url-rewrite-for-subdomain# capture first part of host nameRewriteCond %{HTTP_HOST} ^([^.]+)\.mylocalhost\.com$ [NC]# make sure site= query parameter isn't thereRewriteCond %{QUERY_STRING} !(^|&)site= [NC]# rewrite to current URI?site=backererence #1 from host nameRewriteRule ^ %{REQUEST_URI}?site=%1 [L,QSA]but both not working for me.my root .htaccss file is<IfModule mod_rewrite.c>  RewriteEngine on  RewriteRule    ^$ app/webroot/    [L]  RewriteRule    (.*) app/webroot/$1 [L]</IfModule>\app.htaccess<IfModule mod_rewrite.c>    RewriteEngine on    RewriteRule    ^$    webroot/    [L]    RewriteRule    (.*) webroot/$1    [L]</IfModule>\app\webroot.htaccess<IfModule mod_rewrite.c>    RewriteEngine On    RewriteCond %{REQUEST_FILENAME} !-d    RewriteCond %{REQUEST_FILENAME} !-f    RewriteRule ^(.*)$ index.php [QSA,L]</IfModule>Virtual Host in httpd.conf<VirtualHost *:80>     DocumentRoot E:/xampp/htdocs/bsale   ServerName mylocalhost.com   ServerAlias *.mylocalhost.com   <Directory C:/xampp/htdocs/bsale>       Order allow,deny       Allow from all   </Directory></VirtualHost>HOST FILE127.0.0.1   mylocalhost.com127.0.0.1   *.mylocalhost.com
URL rewrite issue with cakephp
htaccess;mod rewrite;url rewriting