Get a free website with any plan

See how
WORDPRESS

Installing WordPress in a subdirectory

Last updated

IN SHORT

Installing WordPress in a subdirectory (like yourdomain.com/blog/) keeps your homepage on separate software while WordPress runs underneath it. Use the install wizard's Step 1 to set the path, or install manually and point the site URL at the subdirectory. Flashcloud auto-issues one SSL certificate covering the whole domain, subdirectory included.

Sometimes you want WordPress to run at yourdomain.com/blog/ instead of the root, with the homepage hosted by something else (a static landing page, another CMS, a simple HTML site).

Easiest: from the install wizard

  1. Go to Services → click hosting → WordPress tile → Install.
  2. In Step 1, set the install path to your desired subdirectory (e.g., blog).
  3. Continue the wizard normally.

WordPress installs at /public_html/blog/ and is reachable at yourdomain.com/blog/. The homepage at yourdomain.com continues to serve whatever's at /public_html/index.html (or index.php).

What it looks like

  • Homepage: yourdomain.com → whatever you have at the document root.
  • WordPress: yourdomain.com/blog/ → WordPress site.
  • WP admin: yourdomain.com/blog/wp-admin/.
  • Subdirectory pages: yourdomain.com/blog/your-post-name/.

Subdirectory vs subdomain

A different option: install WordPress at a subdomain (blog.yourdomain.com) instead of a subdirectory. See Setting up subdomains.

Differences:

  • Subdirectory (yourdomain.com/blog): same domain. SEO-friendly — link equity flows.
  • Subdomain (blog.yourdomain.com): different host. Treated more like separate sites by some search engines (less link-equity flow).

Subdirectory is generally recommended for content meant to support the main site (a blog supporting a SaaS product, etc.). Subdomain is fine for genuinely separate sites.

Manual install in subdirectory

If you're not using the install wizard:

  1. Create the subdirectory: mkdir public_html/blog.
  2. Upload WordPress to the subdirectory.
  3. Run the WordPress installer: visit yourdomain.com/blog/wp-admin/install.php.
  4. Set the site URL during install: https://yourdomain.com/blog.

Same destination, slower path.

Permalink configuration

In WordPress admin → Settings → Permalinks. Pick a permalink structure (most common: "Post name").

WordPress generates the rewrite rules and writes them to /blog/.htaccess. The rules apply only within the subdirectory, leaving yourdomain.com/index.html alone.

When the homepage's content conflicts

A common issue: you have both yourdomain.com/index.html (your landing page) and yourdomain.com/index.php (which would be served if Apache prefers PHP).

Fix the order in .htaccess:

DirectoryIndex index.html index.php

This tells the server to look for index.html first, then index.php. Now your landing page wins for the root, but WordPress (which routes through index.php) still works for /blog/ and beyond.

SSL on subdirectory installs

We auto-issue a single SSL certificate for yourdomain.com and www.yourdomain.com, which covers the subdirectory automatically. No special config.

"Show WordPress on the homepage but install in a subdirectory"

A common WordPress pattern: install in /wordpress/ for cleanliness, but make the homepage at yourdomain.com serve WordPress content.

In WordPress admin → Settings → General:

  • WordPress Address (URL): https://yourdomain.com/wordpress
  • Site Address (URL): https://yourdomain.com (without subdirectory)

Then:

  • Copy index.php from /wordpress/ to the document root.
  • In the copy at the root, change require( __DIR__ . '/wp-blog-header.php' ); to require( __DIR__ . '/wordpress/wp-blog-header.php' );.
  • Copy .htaccess from /wordpress/ to root if needed.

Now WordPress files live in /wordpress/, but visitors hit yourdomain.com and see WordPress content. URLs in the address bar are clean — /about/ not /wordpress/about/.

This is documented at WordPress.org → Giving WordPress Its Own Directory.

Power-user note

For multi-site WordPress with subdirectories (one WordPress install serving yourdomain.com, yourdomain.com/site2, etc.), turn on WordPress Multisite. More complex but powerful — common pattern for SaaS products built on WordPress.

Common questions

Will installing WordPress in a subdirectory break my existing homepage?

No. WordPress installs at /public_html/blog/ and your homepage keeps serving whatever's already at the document root, whether that's index.html or index.php. If both files exist and Apache picks the wrong one, set DirectoryIndex index.html index.php in .htaccess to force your landing page to win at the root.

Do I need a new SSL certificate for the subdirectory?

No. Flashcloud auto-issues one SSL certificate for yourdomain.com and www.yourdomain.com, and it covers the subdirectory automatically. No extra setup needed.

Should I use a subdirectory or a subdomain for my blog?

Use a subdirectory (yourdomain.com/blog) if the content supports your main site. It's SEO-friendly because it's the same domain and link equity flows normally. A subdomain (blog.yourdomain.com) is treated more like a separate site by some search engines, so it's better suited to genuinely separate projects.

Can I install WordPress in a subdirectory but show it on the homepage?

Yes. Install WordPress in a folder like /wordpress/, then set the Site Address (URL) in Settings to your root domain while keeping the WordPress Address (URL) pointed at the subdirectory. You'll also need to copy index.php to the root and update its require() path to point back into /wordpress/.

Why do my WordPress permalinks only work inside the subdirectory?

That's expected. WordPress writes its rewrite rules to /blog/.htaccess when you set a permalink structure in Settings, so those rules apply only within that subdirectory and leave yourdomain.com/index.html untouched.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.