I've been trying to accomplish this for hours now and for some reason it does not want to work.
All I want is username.domain.com to internally go to domain.com/users/username
I set-up my dns that the wildcard subdomain points towards public_html/wild folder and I placed an index.html file in there and all seems to work well.
The problem is when I use this .htaccess file:
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-]+)\.domain\.com$ [NC]
RewriteRule !^index\.php($|/) index.php/users/%2%{REQUEST_URI} [PT,L]
It shows a 404 page not found error. I checked the logs and it says it still looks in the /wild folder, however my script is one level up in the public_html folder.
How can I fix this problem? Thank you!