Ok I am making a website and I have apache 2, php, mysql. I want users to be able to create a website(i got that part, it is easy) but I want

user.example.com to redirect to

with a .htaccess file

and sorry this is in the wrong section can you tell me whee it should have been posted

I figured it out and for anyone who is reading this save the following as .htaccess in public_html

Options +FollowSymlinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www\.)?example\.com
RewriteCond %{REQUEST_URI} !^/example\.com
RewriteRule (.*) /example\.com/$1 [L]

oh and i also forgot. you have to create a wildcard by adding an A record with the name of * for the ip address of your server

This question has already been answered. Start a new discussion instead.