iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Use Apache’s DirectoryIndex directive to choose the file served for a directory URL. For example, to serve home.html instead of index.html, place this directive in the applicable server, virtual-host, directory, or permitted .htaccess configuration:
DirectoryIndex home.html
Apache’s mod_dir module checks the configured names when a client requests a directory with a trailing slash. You can provide one filename, an ordered fallback list, or a redirect policy. The correct location depends on which directories and sites should use the setting.
What Apache’s default index setting controls
When a browser requests a directory URL such as https://example.com/docs/, Apache must decide which resource represents that directory. The mod_dir module performs this directory-index lookup. The Apache HTTP Server 2.4 documentation identifies index.html as the documented default resource.
DirectoryIndex sets the list of resources Apache checks. Each value is treated as a local URL relative to the requested directory. Thus, if the request is for /docs/, DirectoryIndex home.html means /docs/home.html, not a file at the server’s document root.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
The directive changes what Apache serves for a directory request; it does not rename files, move them, or alter links in your application. The target file must exist in the directory represented by the URL, or Apache will continue through any configured fallback entries.
Choose the configuration scope
Apache permits DirectoryIndex in four contexts. Use the narrowest scope that matches the change you need.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
| Scope | Use it when | Important detail |
|---|---|---|
| Server configuration | The same index policy should apply broadly across the server. | Administrative configuration is required. |
| Virtual-host configuration | One website needs a different default from other virtual hosts. | Keep the rule inside that site’s virtual-host definition. |
| Directory section | A particular directory tree needs its own index policy. | The value is resolved relative to requests for that directory. |
.htaccess |
You need a per-directory setting without editing the main Apache configuration. | The server must allow the Indexes override for that directory. |
Hosting panels and Linux distributions may generate Apache configuration from their own interfaces. Those interfaces are not uniform, so the portable method is to put the directive in the Apache context that governs the directory you want to change.
Set one file, such as home.html
For a simple replacement, use one directive in the relevant configuration scope:
DirectoryIndex home.html
For a site whose document root contains home.html, a request for / or the document-root directory with a trailing slash will cause Apache to look for that file. The same rule in a directory-specific context applies to that directory rather than automatically changing every directory on the server.
- Put the target file in the directory represented by the request. For the site root, that normally means the document-root directory; for
/portal/, it means theportaldirectory. - Add
DirectoryIndex home.htmlto the intended configuration scope. Use the server or virtual-host configuration for an administrative change, a directory section for one tree, or.htaccesswhen that override is allowed. - Request the directory with a trailing slash. Test the exact directory URL, such as
/or/portal/, rather than requesting the file directly. - Check the result against the configured list. If another index directive is inherited, Apache may still search inherited names unless you reset the list first.
Changing the directive does not require changing the browser’s address bar. By default, Apache selects the index internally and leaves the directory URL visible.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Use a different index in a subdirectory
Because index values are local URLs, a rule can be limited to a subdirectory. For example, a directory-specific configuration for /portal/ can contain:
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
DirectoryIndex portal-home.html
Apache then looks for /portal/portal-home.html when a client requests /portal/. A .htaccess file placed in that directory can express the same policy:
DirectoryIndex portal-home.html
Do not write a filesystem path such as /var/www/html/portal/portal-home.html as the index value. The directive expects a resource name or local URL, not an operating-system path. If you need a rule for a nested directory, place it in that directory’s configuration scope or its own permitted .htaccess file.
Configure ordered fallback files
You can list several resources on one directive. Apache checks them from left to right and serves the first one it finds:
DirectoryIndex index.php index.html home.html
With that order, a request for a directory first looks for index.php. If it is absent, Apache checks index.html, then home.html. Ordering is therefore a policy decision: put the preferred application entry point first and use static pages only as deliberate fallbacks.
A single directive can contain a single filename or multiple filenames. The entries are not alternatives selected randomly; the first existing resource wins. This makes the list useful during migrations, when an older static entry page must remain available until a new one is deployed.
If none of the listed resources exists, Apache does not invent an index file. A directory listing is a separate behavior supplied by the mod_autoindex module and is available only when the Indexes option is enabled for that directory. If autoindexing is not enabled, a missing index should not be expected to turn into a file listing.
Replace an inherited index list
Repeated DirectoryIndex directives add entries to the existing list. Therefore, adding this line:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchRank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
DirectoryIndex home.html
does not necessarily remove an index.html value defined in a broader server, virtual-host, or directory context. Apache can retain the inherited entry and append the new one.
To replace the inherited list, reset it first and then define the new value:
DirectoryIndex disabled
DirectoryIndex home.html
disabled is a control value only when it is the sole argument on that directive. In a line containing other arguments, Apache treats disabled as a literal resource name rather than as a reset command. Keep the reset and the new list on separate directives.
You can use the same pattern before a fallback list:
DirectoryIndex disabled
DirectoryIndex home.html index.html
This creates an explicit, two-entry policy instead of extending an unknown inherited list.
Set the index in .htaccess
.htaccess is a valid context for DirectoryIndex, but Apache classifies the directive under the Indexes override class. The server configuration must therefore allow the Indexes override for the directory containing the file.
A permitted .htaccess file can contain:
DirectoryIndex home.html
If the rule appears to do nothing, the most likely configuration issue is that the applicable AllowOverride policy does not permit Indexes. In that case, the setting cannot be activated from .htaccess. An administrator must either enable the appropriate override for that directory or move the directive into the server, virtual-host, or directory configuration.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
Use .htaccess only in the directory tree where its scope is intended. A file in the document root affects requests beneath that root, while a file in a subdirectory can establish a more local policy. Remember that inherited directives may still contribute entries; use the disabled reset when replacement, rather than addition, is required.
Free tools Windows power users keep installed
One-click scans. No signup required.
Keep the browser URL or redirect it
By default, Apache serves the selected index internally. A request for /docs/ can receive the contents of /docs/home.html while the browser continues to display /docs/.
The separate DirectoryIndexRedirect directive changes this behavior by making Apache issue an external redirect to the selected index resource. The documented modes include temporary, permanent, seeother, and explicit 3xx status codes.
| Behavior | What the client sees | When it is appropriate |
|---|---|---|
Normal DirectoryIndex |
The directory URL remains in the address bar while Apache serves the index. | Use when the directory URL is the public address you want users and links to retain. |
DirectoryIndexRedirect temporary mode |
The client is redirected to the selected index for a temporary change. | Use only when exposing the filename is intentional and the move is not permanent. |
DirectoryIndexRedirect permanent mode |
The client receives a permanent redirect to the index resource. | Use when the index URL is deliberately the long-term public URL. |
DirectoryIndexRedirect seeother |
The documented “see other” redirect behavior is used. | Use when that specific redirect semantics is required. |
DirectoryIndexRedirect with an explicit 3xx code |
The selected redirect status is returned. | Use when your URL policy requires a particular 3xx response. |
Do not enable a redirect merely to make a different filename load. The ordinary internal lookup avoids an extra client-visible URL change. Choose a redirect only when the index filename itself is part of your URL design.
Understand trailing-slash normalization
Directory indexing is evaluated for the trailing-slash form of a directory URL. When a client requests a directory without the slash, Apache’s DirectorySlash behavior normally redirects it to the slash form first. For example, /docs is normally normalized to /docs/, after which DirectoryIndex searches for the configured resource.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →This produces a sequence that is easy to diagnose:
- The client requests a directory without a trailing slash.
DirectorySlashnormally redirects the client to the slash form.DirectoryIndexchecks the configured filenames for that directory.- If no index matches, any directory listing depends on the separate autoindex settings.
The Apache documentation warns that disabling the slash redirect can expose directory contents in configurations where mod_autoindex is active. Leave the default slash normalization enabled unless you have a specific, tested reason to change it.
What happens when the chosen file is missing
A missing preferred file is not silently replaced by an arbitrary page. Apache follows the configured order. With:
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
DirectoryIndex home.html index.html
it checks home.html first and then index.html. If both are absent, Apache has no matching directory index from that list.
At that point, a listing can appear only if the directory permits the Indexes option and the separate mod_autoindex module handles the request. If autoindexing is disabled, do not expect Apache to generate a listing as a substitute. The resulting response is determined by the rest of the directory and server configuration, but it is not a successful match for DirectoryIndex.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsThis distinction matters operationally: adding a filename to the list does not enable directory browsing, and enabling directory browsing does not create an index file. Treat the index policy and autoindex policy as separate decisions.
Configuration examples by scope
Virtual host with a static home page
<VirtualHost *:80>
ServerName example.com
DirectoryIndex home.html
</VirtualHost>
This expresses the intent for one virtual host. The exact surrounding virtual-host settings depend on your server configuration; keep the index directive inside the host whose site should use it.
Directory-specific fallback
<Directory "/path/to/site/portal">
DirectoryIndex portal.html index.html
</Directory>
The entries are resolved as resources in the directory represented by that configuration. The first existing file is served.
Per-directory override
# .htaccess in the directory
DirectoryIndex disabled
DirectoryIndex home.html index.html
This version intentionally replaces inherited entries before establishing its own two-file order. It works only where the server permits the Indexes override.
Recommended Free Tools
Quick Recap
Troubleshoot a default index that does not change
| Symptom | Likely explanation | Action |
|---|---|---|
index.html still loads before the new file. |
An inherited DirectoryIndex entry is still in the list, or the desired file is absent. |
Confirm the file is in the requested directory. If replacement is intended, use DirectoryIndex disabled on its own line, followed by the desired list. |
The .htaccess directive is ignored or rejected. |
The directory does not permit the Indexes override. |
Ask the administrator to allow that override or move the directive to server, virtual-host, or directory configuration. |
| The browser URL does not change to the filename. | That is the normal internal-serving behavior. | Leave it as-is if the directory URL should remain public. Use DirectoryIndexRedirect only when an external redirect is required. |
| A directory listing appears instead of a page. | No configured index exists and autoindexing is enabled. | Add the intended index file or adjust the ordered list. Review the separate Indexes/mod_autoindex policy if listings are not wanted. |
| No listing appears when all index files are missing. | Autoindexing is not enabled for that directory. | Do not treat this as evidence that DirectoryIndex is broken; provide a real index resource or configure listing behavior separately. |
/section behaves differently from /section/. |
The first request is subject to trailing-slash normalization. | Test the slash form and review DirectorySlash before diagnosing the index rule. |
| A subdirectory serves the site-wide page. | The subdirectory has no local rule or file, so broader configuration is being used. | Place the subdirectory’s directive in its directory scope or its permitted .htaccess file, and ensure the target file is there. |
Choose the simplest policy that matches your site
- One canonical page: use a single value such as
DirectoryIndex home.html. - Compatibility during a migration: use an ordered list such as
DirectoryIndex new.html index.html, with the preferred resource first. - Do not inherit older entries: reset with
DirectoryIndex disabled, then define the complete list. - Keep clean directory URLs: use normal internal index serving and leave the browser URL unchanged.
- Expose the filename deliberately: configure
DirectoryIndexRedirectwith the redirect mode appropriate to the change. - Avoid accidental browsing: ensure a valid index exists and understand whether the directory’s
Indexesoption andmod_autoindexpermit listings.
Final verification checklist
- Identify the directory URL that should change and use its trailing-slash form for testing.
- Place the desired file in that directory and verify that its name matches the directive exactly.
- Confirm the directive is in the intended server, virtual-host, directory, or
.htaccessscope. - If using
.htaccess, confirm thatIndexesoverrides are allowed. - Check whether a broader configuration contributes inherited entries.
- Reset with
DirectoryIndex disabledbefore the new list when you need replacement rather than addition. - Test fallback behavior by checking what happens when the first listed file is absent.
- Decide separately whether external redirects or directory listings are wanted; neither is required for a normal index lookup.
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.

