R
R
Roman Lankin2017-01-22 02:11:22
Apache HTTP Server
Roman Lankin, 2017-01-22 02:11:22

How can I redirect nested directories to a subdomain/path using mod_rewrite, provided that some directories have their own htaccess inside?

There is a site domain.com
It has a /showroom directory
It is also a document root for the showroom.domain.com subdomain It is
necessary that if you go to the server as a folder, it would send a 302 redirect to the subdomain with an addition in the form of a path
That is, domain.com/showroom /something -> 302-> showroom.domain.com/something
This is what I did:
Allow from all
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule ^(.*)$ showroom.domain.com/$1? [R=302,L]
And everything is fine, but there are also nested directories, for example showroom.domain.com/something/somewebsite
And they have their own .htaccess
Of course, I put
RewriteOptions inherit in it
However, domain.com/showroom/something/somewebsite redirects to showroom.domain.com
Completely ignoring the further path.
Where to dig?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question