Answer the question
In order to leave comments, you need to log in
Redirect to subdomain folder via RewriteRule
Good afternoon.
There is a /market directory at the root of the website,
you need to make requests to market.site.com go to site.com/market , but not as a redirect, but so that the market.site.com domain remains
RewriteBase /
RewriteCond %{REQUEST_URI} !^/market
RewriteCond %{HTTP_HOST} ^market.site.com$ [NC]
RewriteRule ^(.*)$ /market/$1 [L,QSA]
RewriteBase /
RewriteCond %{REQUEST_URI} !^/market
RewriteCond %{HTTP_HOST} ^market.site.com$ [NC]
RewriteRule ^index\.php(.*)$ /market/$1 [L,QSA]
Answer the question
In order to leave comments, you need to log in
This is how I always do it.
RewriteEngine On
RewriteRule ^market/ - [L]
RewriteCond %{HTTP_HOST} ^market\.site\.ru$
RewriteCond %{DOCUMENT_ROOT}/market%{REQUEST_URI} -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R,L]
RewriteCond %{HTTP_HOST} ^market\.site\.ru$
RewriteRule (.*) market/$1 [L,QSA]
RewriteRule ^market/ - [L]
RewriteCond %{HTTP_HOST} ^www\.market\.site\.ru$
RewriteCond %{DOCUMENT_ROOT}/market%{REQUEST_URI} -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R,L]
RewriteCond %{HTTP_HOST} ^www\.market\.site\.ru$
RewriteRule (.*) market/$1 [L,QSA]
No, you need to work on the same CMS.
The solution has already been found - I wrote in a post with a question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question