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.
<?php $domain = "test.example.com"; $domain_parts = explode(".", $domain); $username = $domain_parts; 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.
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.
Find the answer in similar questions on our website.
- 315 php - smtp email with pear library is not working gives error
- 396 php - Laravel 5.6.15 does not want to accept my post requests
- 73 php - Timber/WooCommerce 3.3.x issue?
- 908 php - Not Redirecting header() . Not echoed anything
- 776 php - laravel execute code after return
- 76 can any one help to me to get variable from jquery and use in php
- 320 PHP MySQL if row exists not doing anything
- 84 php - String of file_get_html can't be edited?
- 897 php - Modify files in /vendor directory and commit changes to composer.lock?
- 803 php - After woocommerce/wordpress registration
- 267 php - Zend Framework 2: Extend ZfcUser with own fields
- 903 php - Symfony Doctrine One to Many does not insert foreign key
- 441 php - Apache2 ModSecurity2 does not work (Ubuntu 14.04)
- 84 php - Merge rows between two arrays of objects based on column value
- 319 php - captcha code interfering with form handler