You need to check if the siteurl differs from the home URL:
if ( get_option( 'siteurl' ) !== get_option( 'home' ) ) { // whatever
This also works if home
is a subdirectory of the root, with WordPress installed in yet another subdirectory. For example: domain.com/blog (URL) and domain.com/blog/wordpress (siteurl).
Related Posts:
- How to point my domain to a WordPress install in a sub-directory?
- Multiple domains for multiple single installs
- Sub-domain or 2nd, temporary different domain?
- Second wordpress installation on subdirectory
- Change multi-site installation from sub-domains to sub-directories
- Can I install a new WordPress site inside a sub-directory of an existing WordPress site?
- Subdomain redirects to subdirectory [closed]
- 2 WordPress sites in 2 sibling folders on one domain
- After changing wp from subdirectory to root I can’t preview any changes to a page or post
- Installed WordPress Location
- Should I install blog on subdomain or subdirectory?
- google xml sitemap won’t work on directory install
- How can i shift my chosen posts to a subdirectory?
- WordPress not handling subdirectory properly
- Does WordPress refer to any files outside of the main install folder (and database)?
- Run two wordpress on the same domain
- wordpress sub-directory sites on a sub-domain?
- Trying to setup a dev subdomain, but url loads as /dev/ instead
- Moving from subdirectory and subdomain -> root
- How to move a WordPress installation to a subdirectory
- WordPress page for one specific page on Google Cloud hosted website?
- How to Install WP to Subdomain but Serve on Subdirectory?
- How to replace a wordpress installation in root directory with another in a subdirectory?
- Index (Home) page not displayed when running wordpress in a subdirectory
- The right way to go about creating a WordPress site from a static site which has WordPress installs in its subdirectory
- Multisite Sub-directories Installation
- How to have WordPress in a sub-folder but hosted in a different place?
- PHP – Move a file into a different folder on the server
- Compare 2 directories in windows
- get_template_directory() vs bloginfo( ‘template_directory’ ) vs TEMPLATEPATH
- Change upload directory for PDF files
- What’s the purpose of index.php in wp-content directory? [duplicate]
- How to share cookies and sessions between domain and subdomain?
- How to use alias domain for multisite installation?
- Installation problems on a domain-name-less server
- How do I serve static content on same domain as WordPress
- Benefits or Problems for using Sub-Directory vs Sub-Domain install of WP Network
- WordPress Multisite. Can domain be used instead of subdomain?
- Multisite: differences between subdomain and subdirectory mode? Can it be switch after installation?
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- Htaccess for Wordpess set on single subdomain
- Can I change get_template_directory_uri()?
- NGinx + WordPress Subdomain Multi with core in Subdirectory
- Site redirects to wrong url when saving settings
- Multisite installation combining subdomains and subdirectories
- Custom Post Type Archive in Sub Folder
- Serve HTTPS requests from subdomain
- Can I put my WordPress theme files in another folder?
- WordPress within a subdirectory of another WordPress environment doesn’t work
- How to Create Hierarchical Directory for Nation Wide Mental Health Services
- How to create new folder in wp-content root same like upload folder?
- Changing Multisite URL after the subsite has been in use
- How do I set up single sign on for multiple WP installs across the same domain?
- Why doesn’t WP_PLUGIN_DIR definition use DIRECTORY_SEPARATOR?
- How to copy one folder to another folder recursively
- issues including a file from a plugin directory
- Moving to a new domain in the same server
- How do I use different domain for subdomains in WP Multisite?
- Multiple Multisite networks on the same domain?
- Disable to create folders for every years and months in uploads folder
- local folder permissions vs chown — security considerations
- How can i run the same WordPress install on multiple subdomains?
- Subdomain and subdirectories together in one installation
- Two domains on one WordPress Installation
- How is a student directory best handled in WordPress?
- Creating directory in uploads: mkdir vs wp_mkdir_p
- One WordPress and database but multiple subdomains
- On WordPress Network(multisite), Sub Blogs in Subdirectories or Subdomains? What’s better?
- Cant get wordpress to work on subdirectory
- Two identical wp-includes directories on server
- What is the recommend directory in which I can upload a new library?
- Multisite Subdomain Using More Resources Than Others?
- Install theme on multiple domains
- How to create an Online Dictionary Using WordPress? [closed]
- Include file from higher level
- Is it good security advice to install wordpress in subdirectory but link to root?
- how to create a folder in wordpress
- Moving to directory creates path problems.. how to solve?
- WP Multisite – domain mapping to domain.com and separate site to domain.com/help
- wordpress blog in subdirectory or subdomain
- How to run a subdirectory multisite install under a subdomain
- Accessing WordPress installation in its own directory at domain root
- Is there any way to allow a plugin to write over a previous version?
- How to retrieve TLD domain for the current website?
- Right permissions to WordPress directory
- Template Hierarchy tag-{slug}.php directory
- wp theme.. Could not create directory
- WordPress installation site folder move to the final site destination
- more than one upload directory?
- WP install in sub-dir white screen
- Change directory of javascript files
- Theme in wp-content but my index.php search theme files in root
- get_query_var not working for subdirectory
- Multiple wordpress installations that shares WordPress & Theme but with separated database
- How to redirect one page on the subdomain
- How can I have nginx serve WordPress at /blog?
- WordPress installed in root, need second in subdirectory with different domain
- Correct folder permissions?
- How to make use of WP templates within a nested site structure?
- Prevent WordPress from interpreting a subfolder?