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
example.com/user

with a .htaccess file

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

It's worth doing a search of previous postings because most common questions have been asked and answered before. I got this link from a previous post:
http://corz.org/serv/tricks/htaccess2.php

If it doesn't answer your question, there are a number of previous posts that you can look at.

Chris

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

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.