Running Wordpress in a subdirectory (and not in the root directory)

I have a wordpress site that is currently running in a subdirectory of my website, basically my structure is as follows: root / sor

I want the WordPress wp folder to be in the same place, but load the wordpress site directly from the root URL.

For example, a site is currently loading when I go to www.mysite.com/wp, but I would like to have a wordpress site load when I just go to www.mysite.com - now if I go to website www.mysite.com it just uploads a message about the internal internal internal network.

I would expect that I would need to make some changes to the htaccess files - can anyone suggest how this will be done

So, in a nutshell When I go to www.mysite.com, it looks at the / wp folder, but it still appears in the address bar as www.mysite.com.

+6
source share
1 answer

Adding these lines to .htaccess should do the job (not verified, sorry, this may not be enough):

RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$ RewriteRule ^(/)?$ wp [L] 

Update: You might want to check out https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory to achieve this, which is closer to WordPress standards.

+4
source

Source: https://habr.com/ru/post/905191/


All Articles