htaccess configuration for wildcard subdomain

Asked

Viewed 76 times

1

Please, I have a wildcard entry in my domain, that is, qualquerNome.meudomino.com.br redirects to mydomain.com.br. I need to configure my htaccess to redirect all entries to a file, in which, according to the subdomain, I redirect properly. How would this htaccess file look, considering that the file that will evaluate this subdomain will receive as follows: .php file? Domain=Xxx. Where XXX is the requested subdomain. I made the second rule below, which works at first, but I cannot standardize the behavior of the rule when it is requested with "www" and without "www".

RewriteCond %{HTTP_HOST} ^(.*)\.dominio\.com\.br
RewriteRule (.*) http://dominio.com.br/domain.php?id=%1 [R=301,L]

Thank you very much for anticipation.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.