Answer the question
In order to leave comments, you need to log in
Subdomains, CNC and mod_rewrite?
I need that when I go to a link, for example music.site.ru/article/trance, mod_rewrite transfers everything except existing files to index.php.
The CNC on the site is already working for me. How to add another subdomain replacement there?
My .htaccess
AddDefaultCharset UTF-8
AddType audio/mpeg mp3
AddType audio/mp4 m4a
AddType audio/ogg ogg
AddType audio/ogg oga
AddType audio/webm webma
AddType audio/wav wav
AddType application/vnd.ms-fontobject eot
AddType font/opentype otf
AddType font/truetype ttf
AddType application/x-font-woff woff
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} \.(mp3|torrent)$
RewriteRule ^.*$ down.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(favicon.ico)$
RewriteRule ^.*$ index.php [L,QSA]
Options -Indexes -ExecCGI -Includes
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>
Answer the question
In order to leave comments, you need to log in
RewriteCond %{HTTP_HOST} ^([^\.]+)\.toster\.ru[NC]
RewriteRule ^/?(.*) http://%2/%1/$1 [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question