R
R
Rustamka Vorontsov2016-02-08 09:08:14
1C-Bitrix
Rustamka Vorontsov, 2016-02-08 09:08:14

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]

thanks for the help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-02-08
@rmfordev

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

In nginx (if used)
server {
      server_name mysite.ru www.mysite.ru *.mysite.ru;  
......
}

I also recommend that you read the article (it’s not quite about that, but it’s useful) https://dev.1c-bitrix.ru/community/webdev/user/614...
There is also something in the documentation (I don’t know how much it will help ) https://dev.1c-bitrix.ru/learning/course/?COURSE_I...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question