October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Fix Apache’s “It Works!” Page Showing Instead of index.html

Apache’s “It Works!” page means the server answered—not that it selected your site. Follow a precise checklist to match the virtual host, correct DocumentRoot, set DirectoryIndex, reload Apache, and diagnose lingering welcome pages.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If Apache shows its “It Works!” welcome page instead of your site’s index.html, Apache is running but the request is reaching the wrong configuration, document root, or index-file rule. Request the intended hostname and port, identify the virtual host that handles it, point that host’s DocumentRoot at the directory containing your files, and make sure DirectoryIndex selects the intended filename. Then reload Apache and use the logs and direct-file requests to confirm the result.

What the “It Works!” page actually tells you

Apache’s Windows documentation describes the post-installation response this way: “httpd should respond with a welcome page and you should see ‘It Works!’” The archived installation guidance likewise treats the welcome page as an expected initial response and recommends checking error.log when access fails.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That page confirms that an Apache process answered the request. It does not confirm that Apache selected the virtual host, port, or document directory you intended. The most common mistake is to edit one configuration while the browser request is being handled by another host block or another Apache instance.

  • Server is responding: the request reached an HTTP service running Apache.
  • Site selection is unresolved: the hostname and port may map to a different virtual host than the one you edited.
  • File selection is unresolved: the active host may use a different DocumentRoot or an earlier DirectoryIndex entry.
  • Access may still be blocked: directory permissions or access rules can prevent Apache from serving the corrected file.

How Apache chooses what to return for /

1. The request selects a virtual host

Apache uses the request’s hostname and port to choose among virtual-host definitions. The host block that matches the request’s ServerName or an alias, together with the listening port, supplies the settings used for that request.

Therefore, these requests can produce different pages even when they reach the same machine:

  • http://example.com/
  • http://www.example.com/
  • http://localhost/
  • http://192.0.2.10/
  • http://example.com:8080/
  • https://example.com/

A request to localhost, an IP address, or another port can select a default or unrelated host instead of your site’s block. HTTP and HTTPS also commonly use separate virtual-host blocks, so correcting the port-80 configuration does not automatically correct the TLS configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. DocumentRoot maps the URL to a directory

Apache defines DocumentRoot as the directory that forms the web-visible document tree. If the active host has DocumentRoot "/var/www/example", a request for /index.html maps to /var/www/example/index.html.

If the file is actually in /var/www/example/public/index.html, Apache will not find it until the active root is changed to /var/www/example/public or the file is moved into the configured root. A correct file in an inactive directory has no effect on the response.

3. DirectoryIndex chooses the default file

When the browser requests a directory such as /, Apache uses the DirectoryIndex setting to determine which filename to try. If the list names another file before index.html, that earlier file can be returned instead. The setting does not change the document root; it changes the default filename selected inside that root.

This distinction explains an important diagnostic: if /index.html displays your site but / displays the welcome page, the host and root are probably correct and the index-file rule needs attention. If both URLs display the welcome page, investigate host selection and DocumentRoot first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fix the problem in the right order

  1. Use the intended URL. Enter the real hostname and the port on which that site’s virtual host listens. Do not diagnose with localhost or an IP address unless that is how the site is configured.
  2. Identify the matching virtual host. Find the host block whose ServerName or alias matches the hostname and whose port matches the URL. This is the block that must be edited.
  3. Verify the document root. Check that its DocumentRoot is the directory containing the deployed files.
  4. Verify the index file. Place index.html directly inside that root, using the exact spelling and case expected by the filesystem.
  5. Check the index order. Inspect DirectoryIndex for another filename listed ahead of index.html. Reorder or remove entries only when you understand what other pages rely on them.
  6. Align access rules. Ensure the relevant <Directory> section applies to the new root and permits Apache to serve its contents.
  7. Reload or restart Apache. Use the normal procedure for the platform and installation, then test again.
  8. Read the logs if the response is unchanged or becomes an error. Check the access and error logs for the request and the reason Apache rejected or redirected it.

Verify the active virtual host before changing files

Match hostname, alias, and port

Open the Apache configuration and locate the <VirtualHost> block that corresponds to the URL you are testing. Its address and port must match the request, and its ServerName or aliases must include the hostname in the browser.

Browser request Configuration details that must match Typical mismatch
http://example.com/ HTTP virtual host, hostname example.com, port 80 Only an HTTPS block or a different hostname is configured
http://www.example.com/ Port 80 host with www.example.com as name or alias The block covers example.com but not the www alias
https://example.com/ HTTPS virtual host for the TLS port and hostname Only the HTTP block was edited
http://example.com:8080/ Virtual host listening on port 8080 for that hostname The site is configured on port 80 while the browser uses 8080

If you are unsure which block receives a request, make the request with the exact hostname and port you intend to support, then correlate it with the access log. A request logged under a different host or listener is evidence that the browser is not reaching the configuration you changed.

Check DNS and the hosts file

The requested name must resolve to the machine whose Apache configuration you edited. Verify DNS, or the local hosts file when testing privately, before treating a persistent welcome page as a file-placement problem. If the name points to another machine, every local change can appear to have no effect because a different server is answering.

Set DocumentRoot to the directory that contains the site

Confirm the file’s actual location

Locate the deployed files on disk and identify the directory that should be visible at the site root. The expected relationship is direct:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
DocumentRoot "/var/www/example"

/var/www/example/index.html

With that arrangement, requesting /index.html reads the file shown in the second line. If your files are nested one level deeper, either change the root to that nested directory or move the files so that index.html is directly beneath the configured root.

Use the root from the host that actually answers

Multiple virtual hosts can have different roots. Changing a global or unrelated DocumentRoot will not fix a request handled by a more specific host block. Edit the root inside the active virtual host, then ensure the matching <Directory> permissions refer to the same path.

Make index.html the directory index

Put the file in the root with exact spelling

Place the intended file directly in the active document root and use the exact filename index.html. Case differences matter on case-sensitive filesystems: Index.html, INDEX.HTML, and index.html are not necessarily the same file.

Inspect competing index names

Look for DirectoryIndex directives in the virtual host, directory configuration, and included configuration files. Apache can try the names in the order listed. If a welcome file appears before index.html, Apache can legitimately return that file even though your intended index exists.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remove or reorder an entry only after checking whether another part of the site depends on it. A safer targeted setting inside the relevant directory is:

DirectoryIndex index.html

This tells Apache which file to use when the request names the directory rather than the file itself. It does not correct a wrong hostname, port, or document root.

A minimal virtual-host configuration

The following pattern shows the relationship between host selection, filesystem mapping, access policy, and the default filename. Replace the example hostname and path with the values used by your installation.

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot "/var/www/example"
    <Directory "/var/www/example">
        Require all granted
        DirectoryIndex index.html
    </Directory>
</VirtualHost>
  • ServerName identifies the hostname this block is intended to serve.
  • *:80 represents the listener and port for ordinary HTTP in this example.
  • DocumentRoot supplies the filesystem base for URL paths.
  • The <Directory> section applies access policy to that same directory.
  • DirectoryIndex index.html makes index.html the default file for a directory request.

Adapt the port, hostname, path, and access policy to the local installation. Do not copy Require all granted blindly into a site with stricter requirements; the important check is that the policy for the active root permits the intended content to be served.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use direct-file requests to isolate the fault

Request the file explicitly rather than requesting only the directory:

http://example.com/index.html

Interpret the result using this decision table:

Result Most likely area to inspect next
/index.html shows your site, but / shows “It Works!” DirectoryIndex order or a competing default file
Both /index.html and / show “It Works!” Hostname/port selection or the active DocumentRoot
Both requests return an access error <Directory> permissions and the error log
The browser shows a different site or redirects elsewhere Another virtual host, proxy, HTTPS configuration, or server answering the request

Use the same scheme, hostname, and port in every test. A successful HTTP test does not prove that the HTTPS virtual host is configured correctly.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Reload Apache and verify the change

After editing the configuration or moving files, reload or restart Apache using the normal procedure for the operating system and installation. A configuration file can be correct on disk but inactive until Apache reads it again.

Then test in this order:

  1. Request the exact hostname and port handled by the edited virtual host.
  2. Request /index.html directly.
  3. Request / and confirm that the directory index now resolves to the intended file.
  4. Repeat the test over HTTPS if the site supports it.
  5. Check the access and error logs for the same request if the result is unexpected.

Clear a cached browser response only after confirming the server response with a fresh request or another client. Caching can preserve an old page, but it cannot make an incorrect virtual host serve the right file.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When the welcome page still appears

The hostname resolves somewhere else

Confirm that DNS or the hosts file maps the requested name to the machine you edited. If the address points to another server, correct the mapping or administer the server that actually receives the request.

The URL uses a different scheme or port

Check the complete browser URL, including http versus https and any explicit port. Separate virtual-host blocks often exist for HTTP and HTTPS, and a nonstandard port can select a different configuration.

A reverse proxy, container, or second Apache instance answers

A proxy or container can terminate the request before it reaches the Apache configuration you edited. A second Apache process can also listen on the port you are testing. The access log for the answering service should show whether the request arrived there; if it does not, trace the request path to the proxy, container, or other process.

The root is correct but access rules reject it

Ensure the relevant <Directory> block points to the same directory as DocumentRoot and permits Apache to read the files. Consult error.log for permission and configuration errors rather than inferring the cause from the browser’s generic error page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The configuration change was not loaded

Reload or restart Apache after changes, and check the error log immediately if the service refuses to reload. A syntax or path error can leave the previous configuration active or prevent the server from starting.

Common mistakes to avoid

  • Editing the default welcome directory: this may change the page shown by the default host but not the site’s actual virtual host.
  • Testing with an IP address: the IP can select a different host from the domain name.
  • Changing only DirectoryIndex: an index rule cannot compensate for a wrong DocumentRoot.
  • Changing only DocumentRoot: a competing earlier index file can still win for /.
  • Ignoring case: the filename must match the filesystem’s spelling rules.
  • Fixing HTTP while testing HTTPS: the browser may be using a separate TLS virtual host.
  • Skipping logs: access and error logs reveal which request arrived and why Apache rejected or served it.

Final verification checklist

  • The browser URL uses the intended scheme, hostname, and port.
  • That hostname resolves to the machine running the configuration you edited.
  • The matching virtual host contains the expected ServerName or alias.
  • Its DocumentRoot contains index.html directly.
  • The filename’s spelling and case are correct.
  • DirectoryIndex does not select an unwanted file first.
  • The matching <Directory> policy permits Apache to serve the root.
  • Apache has been reloaded or restarted after the change.
  • A direct request to /index.html and a request to / produce the expected result.
  • The access and error logs show the request reaching the intended service.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.