A
A
Anton2017-07-10 15:06:41
htaccess
Anton, 2017-07-10 15:06:41

.htaccess - subfolder as root?

Good afternoon.
I have a subdomain at the root of the site itself, site.ru/subdomain
I set up a redirect so that when subdomain.site.ru is accessed, it takes the content from the site.ru/subdomain folder

RewriteCond %{HTTP_HOST} ^subdomain\.site.ru$ [NC]
RewriteCond %{REQUEST_URI} !^/subdomain/.* [NC]
RewriteRule (.*) /subdomain/$1 [L]

Everything is fine here, except that, of course, there is a problem with the paths.
Is it possible to somehow arrange htaccess in this subfolder so that all its contents "think" that this is the root of the site, so as not to rewrite the paths?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-07-10
@Eridani

1. link to the site - but in this case the main site will have the same structure.
2. Throw a proxy if you have nginx + apache in this case, just point the root document to this folder, you can also use a proxy in Apache https://httpd.apache.org/docs/2.4/mod/mod_proxy.html
3. You can to do it through the CNC, you did not specify which engine.
4. and the simplest, if you have access to the apache vhost, then just change the root document in the config to the appropriate folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question