Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Wordpress in a subdirectory (not the root)

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

I'd like to keep the wordpress wp folder in the same place however have it load the wordpress site directly from the root url.

For instance currently the site loads when I go to www.mysite.com/wp however I'd like to have the wordpress site load when I simply go to www.mysite.com - currently if I go to www.mysite.com it simply loads an 500 Internal Server Error message.

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

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

like image 680
Zabs Avatar asked Jan 05 '12 12:01

Zabs


1 Answers

Adding these lines to .htaccess should do the job (not tested, sorry, it may not be sufficient):

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

Update: You might wish to check https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory for a way to accomplish this that's closer to WordPress standards.

like image 174
Olaf Avatar answered Nov 15 '22 06:11

Olaf