M
M
Mitya ToDaSyo2019-07-16 01:04:22
htaccess
Mitya ToDaSyo, 2019-07-16 01:04:22

Subdomain file path, how to set?

Public_html folder for the main 2nd level domain in the hosting root
I need to create subfolders in it and assign them domains to 3rd level domains (from the main one)
I created folders, subdomains,

registered in .htaccess
RewriteCond %{HTTP_HOST} ^sub_1\.site\.ru$ [NC]
    RewriteCond %{REQUEST_URI} !^/sub_1.*$ [NC]
    RewriteRule ^(.*)$ /sub_1/$1 [L,NS]

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

Now I have a file path error, because they refer to the main domain folder
How to fix the error without making changes to the .php files?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-07-16
@dimastik1986

1. What is the control panel?
2. why do you need to create subdirectories for subdomains in the site itself, what is the logic in your opinion? why not just create them as a separate site without these tricks?
3. symlink will help you solve the problem https://linux-notes.org/sozdanie-ssy-lok-symlink-v...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question