how can i access my root folder as subdomain with .htaccess...!!
i.e

mydomain.com/folder
to
folder.mydomain.com

without manually creating it as subdomain in cpanel

This is impossible to do on most hosts unless you have root access or you use a wildcard subdomain. Htaccess files are not able to do this so to accomplish the creation of a subdomain there are two ways of doing it. First way is to create a subdomain just called the single character *
So for example it would be *.mydomain.com then direct your subdomain to a special php script that will sort what each subdomain links to. The other option is if you have root access, to make a php script that modifies the apache httpd.conf file although it is highly unrecommended. Hope that theory helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.