Answer the question
In order to leave comments, you need to log in
Is it possible to implement categories and products as subdomains?
There is a task to display categories and products as subdomains.
Catalog site.ru/catalog/index.php -> catalog.site.ru
Sections site.ru/catalog/index.php?&SECTION_CODE=cat1 -> cat1.site.ru
Product site.ru/catalog/index.php?&SECTION_CODE =cat1&ELEMENT_CODE=prod1 -> prod1.cat1.site.ru
I tried to implement it this way: (For a product)
RewriteEngine On
RewriteCond %{http_host} !^www.site.ru
RewriteCond %{http_host} (www\.)?(.*)\.(.*)\.site\.ru$
RewriteCond %{REQUEST_URI} !^/catalog/
RewriteRule ^(.*)$ /catalog/item.php?ELEMENT_CODE=%2&SECTION_CODE=%3 [QSA,L]
Answer the question
In order to leave comments, you need to log in
You can do this
In the IS settings, set the address parameters joxi.ru/brRYOLxfQ8Kg1A
In the settings of the component joxi.ru/RmzzOeysWV89Vm
After that, I got nfr.supra-test.ru/test1 here look the link in the content goes to a subdomain
In the dns settings you need to add * IN A IPадресСервера
B virtualhost
ServerName mysite.ru
ServerAlias *.mysite.ru
server {
server_name mysite.ru www.mysite.ru *.mysite.ru;
......
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question