В хостинге прописано *.site.ru CNAME site.ru в DNS
В htaccess:
Созданы поддомены модулем SEO () если перейти на site.ru грузится Москва, если на penza.site.ru то Пенза но если зайти на 123.site.ru то сайт открывается но модуль не подгружает данные т.к. через модуль не создан город 123, помогите сделать так чтобы если не существует такого поддомена в модуле то ридерект был на основной site.ru
В htaccess:
| Код |
|---|
Options -Indexes
ErrorDocument 404 /404.php
php_flag opcache.enable Off
SetEnv noconntimeout 1
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(php|html|htm)\ HTTP/
RewriteRule ^(.*)index\.(php|html|htm)$ $1 [R=301,L]
RewriteCond %{REQUEST_URI} !\?
RewriteCond %{REQUEST_URI} !\&
RewriteCond %{REQUEST_URI} !\=
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} !\/$
RewriteRule ^(.*[^\/])$ /$1/ [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
<IfModule mod_php5.c>
php_flag session.use_trans_sid off
php_flag suhosin.simulation 1
#php_value display_errors 1
#php_value mbstring.internal_encoding UTF-8
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
RewriteCond %{HTTP_HOST} ^www\.samara\.site\.ru [NC]
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L,R=301]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^robots\.txt seo/krsk/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap\.xml seo/krsk/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/krsk/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/krsk/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/krsk/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/krsk/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/krsk/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/krsk/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/krsk/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} krsk.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/krsk/sitemap_iblock_10.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^robots\.txt seo/samara/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap\.xml seo/samara/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/samara/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/samara/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/samara/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/samara/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/samara/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/samara/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/samara/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} samara.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/samara/sitemap_iblock_10.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^robots\.txt seo/tlt/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap\.xml seo/tlt/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/tlt/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/tlt/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/tlt/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/tlt/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/tlt/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/tlt/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/tlt/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} tlt.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/tlt/sitemap_iblock_10.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^robots\.txt seo/orenburg/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap\.xml seo/orenburg/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/orenburg/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/orenburg/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/orenburg/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/orenburg/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/orenburg/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/orenburg/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/orenburg/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} orenburg.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/orenburg/sitemap_iblock_10.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^robots\.txt seo/penza/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap\.xml seo/penza/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/penza/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/penza/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/penza/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/penza/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/penza/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/penza/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/penza/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} penza.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/penza/sitemap_iblock_10.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^robots\.txt seo/saratov/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap\.xml seo/saratov/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/saratov/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/saratov/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/saratov/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/saratov/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/saratov/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/saratov/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/saratov/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} saratov.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/saratov/sitemap_iblock_10.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^robots\.txt seo/ylianovsk/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap\.xml seo/ylianovsk/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/ylianovsk/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/ylianovsk/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/ylianovsk/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/ylianovsk/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/ylianovsk/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/ylianovsk/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/ylianovsk/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} ylianovsk.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/ylianovsk/sitemap_iblock_10.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^robots\.txt seo/yralsk/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap\.xml seo/yralsk/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/yralsk/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/yralsk/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/yralsk/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/yralsk/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/yralsk/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/yralsk/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/yralsk/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} yralsk.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/yralsk/sitemap_iblock_10.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^robots\.txt seo/buzuluk/robots.txt [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap\.xml seo/buzuluk/sitemap.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap_files\.xml seo/buzuluk/sitemap_files.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap_iblock_4\.xml seo/buzuluk/sitemap_iblock_4.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap_iblock_5\.xml seo/buzuluk/sitemap_iblock_5.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap_iblock_6\.xml seo/buzuluk/sitemap_iblock_6.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap_iblock_7\.xml seo/buzuluk/sitemap_iblock_7.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap_iblock_8\.xml seo/buzuluk/sitemap_iblock_8.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap_iblock_9\.xml seo/buzuluk/sitemap_iblock_9.xml [NC,L]
RewriteCond %{HTTP_HOST} buzuluk.site.ru [NC]
RewriteRule ^sitemap_iblock_10\.xml seo/buzuluk/sitemap_iblock_10.xml [NC,L]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
ExpiresByType image/png "access plus 3 day"
ExpiresByType text/css "access plus 3 day"
ExpiresByType application/javascript "access plus 3 day"
</IfModule>
|