I am not familiar with .htaccess . I am trying to create .htaccess file which will redirect the any subdomain to portfolio.
For example : bob.example.com
,
which will redirect to the bob portfolio. in background script will be executed following way.
example.com/portfolio.php?id=bob
I have written following .htaccess
RewriteCond %{HTTP_HOST} !^([w]{3,3}[.]{1,1}){0,1}example.com$
RewriteCond %{HTTP_HOST} ^([0-9a-zA-Z-]*)[.]example.com$
RewriteRule ^.*$ http://example.com/portfolio/index.php?id=%1 [R,L]
Issue is , if i use bob.example.com then it actually redirect to example.com/portfolio/index.php?id=bob
if use bob.example.com then must open portfolio direct , instead of redirection
Alright , i managed my self to create it
RewriteRule ^$ portfolio/index.php?id=%1 [NC,L]
Above statement works perfectly ! Thank you !