How can set up WordPress in a sub-directory ? I wanted to install WordPress <root>/support so that I can access WordPress with example.com/support. I also want to redirect example.com to example.com/support. I tried different example like this. https://community.wordops.net/d/85-wp-in-a-directory/4
location /support { try_files $uri $uri/ /support/index.php?$args; }
define( 'WP_HOME', 'https://example.com/support' ); define( 'WP_SITEURL', 'https://example.com/support' );
Any help is greatly appreciated! Thanks
devnepsys
it is quite easy to setup subdirectories sites by the following command:
sudo wo site create mydomain.com —subdir —php74
as to redirection, if I were you, I will use the plugin of redirection at https://wordpress.org/plugins/redirection/ Or set dns forward but not handle the redirection on Nginx.
you do not need do this : Then, I moved all wordpress file from /var/www/example.com/ to /var/www/example.com/support/
in Wordpress multisites both in subdomain or subdirectotory, you can setup any subsite on your primary site.
firstly, follow the guidelines of official document at https://docs.wordops.net/commands/site/#site-create
1#create multisites with subdirectories 2#create a sub site on your primary site 3#use redirection plugin to redirect all access to the subsite of support.
devnepsys Any help is greatly appreciated!
Are you getting errors of some kind? What isn't working?
alexlii1971 I already tried with multisite subdirectory. But still, I had to manually configure for a primary site to access with https://example.com/support instead of https://example.com/, and with sub site, I wasn't able to maintain the file structure (URL for the static resource) and migration is very difficult. So, multisite looks overkill for setting a single site. Because, I already have running website in this format (subdirectory) in Apache and I have to maintain the whole URL and file structure.
Hosted by VirtuBox