N
N
nanny_ogg2016-12-17 21:37:09
htaccess
nanny_ogg, 2016-12-17 21:37:09

How to properly set up a subdomain redirect on timeweb hosting if both sites are on wordpress?

The main site is in the public_html folder, the subdomain is in the same place in a separate folder. There is a redirect in .htaccess.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^subdomain\.domain\.ru$
RewriteCond %{REQUEST_URI} !/subdomain/
RewriteRule ^(.*)$ /subdomain/$1 [L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress

The site on the subdomain is displayed, but the trouble is with styles and js. The styles of the main site are included, not the subdomain site. Has anyone encountered such a problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jimmy Neutron, 2016-12-18
@SkyShot

There are settings in the admin panel, fix the link there, make the subdomain type site.site.ru, not site.ru/site
Settings -> General
WordPress Address (URL) and Site Address (URL)
Should help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question