A
A
Andrew Romanov2014-03-13 17:57:57
Apache HTTP Server
Andrew Romanov, 2014-03-13 17:57:57

How to merge a subdomain with a root domain folder?

It is necessary that when you go to https://sub.example.com , https://example.com/sub opens and https://sub.example.com is displayed in the browser bar. I'm trying to implement this using .htaccess at the root example.com RewriteEngine On #RewriteBase / RewriteCond %{HTTP_HOST} ^(sub)\.example\.biz$ RewriteCond %{REQUEST_URI} !/%1/ RewriteRule ^(.*)$ /%1/$1 [L ,QSA] example.com and sub.example.com are attached to the same directory sites work only on https but the redirect happens to the root site, not the directory.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Somov, 2014-03-13
@neuron_by

I ran into a similar problem, I didn’t resolve it on htaccess, I resolved it on php by replacing
$_SERVER['REQUEST_URI']

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question