Answer the question
In order to leave comments, you need to log in
Apache2 mod_rewrite creating subdomains
Question about setting up sub-domains for Apache.
There is a dedicated server (Debian) with full access. Where do you need to register and what exactly to make sub-domains work?
You need several virtual sub-domains, like vip.domain.loc or profile.domain.loc. The redirect should be to the domain.loc root site folder.
There are actually several questions ...
Do I need to register sub-domains in the /etc/hosts file and in the settings file (VirtualHost) in the sites-available directory? What should be the rules for forwarding?
I will be glad for any answers.
Answer the question
In order to leave comments, you need to log in
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain.com
RewriteCond %{HTTP_HOST} ([^.]+)\.domain.com
RewriteRule ^(.*)$ /user.php?username=%1
ServerAlias *.host.com
I hope you can configure htaccess?
PS If anything, write in a personal - I'll help you that it's not clear!
The rewrite mod has nothing to do with it, just set up virtual domains (subdomains in your case) that link to where you need to.
setting up conf for apache, you don't even need a rewrite
create virtual servers, specify the necessary paths and domain names in the ServerName directive
if you want to use one multi-domain engine, then you just need to refer everything to it and cms itself will resolve the domains
So what do you want in the end ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question