This would not go into .htaccess, it would go into you httpd.conf file. Look into this question: VirtualHost with wildcard VirtualDocumentRoot

You would also need to setup a wildcard dns record for *.example.com to point to your server. In PHP you would have something like this as the index.php file for your wildcard.

    $domain = "test.example.com";
    $domain_parts = explode(".", $domain);
    $username = $domain_parts[0];
    header("location: http://example.com/".$username);

People are also looking for solutions to the problem: java - Android Studio App Wont Run through database


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.