Answer the question
In order to leave comments, you need to log in
Running a subdomain on drupal in a subfolder?
Hello!
It was necessary to create a large number of subdomains for the site, the hoster - runs - does not support autosubdomains and regards each added subdomain as a separate site. I will not meet the limits of the number of sites. The database and content should be different for everyone.
I decided to try to generate subdomains through htaccess - create a directory /subdomains/ , put folders with my subdomains in it, copy the site distributions into them; do the same with bases.
htaccess code
RewriteCond %{HTTP_HOST} !^www\.net-narco\.ru$
RewriteCond %{HTTP_HOST} ^(.+)\.net-narco\.ru$
RewriteCond %{REQUEST_URI} !/%1/
RewriteRule ^(.*)$ /subdomains/%1/$1 [L,QSA]
site.ru
site.ru/subdomains/volhov/
volhov.site.ru
volhov.site.ru/subdomains/volhov/%some-article%
volhov.site.ru/subdomains/volhov/%some-article%
, but volhov.site.ru/%some-article%
?
Answer the question
In order to leave comments, you need to log in
Have you added $base_url to setting.php for new sites?
And there is a lot of useful stuff here: https://www.drupal.org/docs/7/multisite
For example,
If you need SEO, it will be easier to create a bunch of subdomains (while not creating a new site), send them to the main site, write a module that will tamper with this or that information by the domain name, for example, contact information, and, in principle, everything
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question