To remove /index.php/ from WordPress links, select a clean permalink structure under Settings → Permalinks, save it, and make sure the web server sends unknown paths to WordPress’s front controller. On Apache this normally means a working .htaccess rewrite configuration; on standalone Nginx it requires a server-block rule; on IIS it uses web.config. Changing the setting without the matching server configuration commonly produces 404 errors.
The path is not evidence of a damaged WordPress installation. WordPress calls URLs containing it “Almost Pretty” permalinks. The fix is a coordinated dashboard and server change, followed by testing and, where necessary, redirects from the old URLs.
As an Amazon Associate I earn from qualifying purchases.
What /index.php/ means in WordPress
WordPress supports several permalink styles. The “Almost Pretty” form places index.php before the date or post path, for example https://example.com/index.php/2026/10/18/example-post/. WordPress documents this as a valid permalink type, not a failure state. It often appears when the server is not configured to rewrite friendly paths directly to WordPress.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Pretty permalinks remove that visible front-controller filename. A post-name structure produces a path such as https://example.com/example-post/, but only when the server can route that request to WordPress. WordPress’s own guidance says the hosting provider must configure the web server for Pretty or Almost Pretty permalinks. See WordPress’s permalink documentation for the supported structures and examples.
#1 Best Overall
In practical terms, the job has two parts:
- Choose the desired URL pattern in the WordPress dashboard.
- Provide the rewrite rule that passes requests for virtual paths to
index.phpwhile allowing real files and directories to load normally.
If either part is missing, the old structure may continue to appear or the new structure may return 404 responses.
Before you change the permalink structure
Permalinks are public addresses. A change affects links in search results, bookmarks, social posts, feeds, XML sitemaps, internal links, and integrations that store URLs. Prepare a recovery path before saving a new structure.
- Record the current permalink pattern and save a backup of the site and database.
- Confirm whether the site runs on Apache, standalone Nginx, IIS, or a reverse-proxy arrangement. Configuration files and responsibilities differ.
- Make sure you can access the hosting file manager, SSH, server configuration, or support team if a rewrite rule must be installed manually.
- List representative URLs to test later: a post, a page, a category or tag archive, the home page, an attachment if the site uses them, and
/wp-admin/. - Plan redirects from the old URLs if visitors or search engines already use them. WordPress does not promise that every historical path will be redirected automatically after a structure change.
Do not delete an existing .htaccess file or replace a complete server configuration without a backup. That file may contain security, caching, redirects, or host-specific directives unrelated to WordPress.
Free tools Windows power users keep installed
One-click scans. No signup required.
Change the setting in WordPress
- Sign in as an administrator.
- Open Settings → Permalinks.
- Choose an available structure. For a simple post-name URL, choose Post name, which uses the
%postname%structure tag. Select a different pattern if the site’s established URL policy requires dates, categories, or another stable component. - Click Save Changes.
- Open a new browser tab or an incognito window and test the home page, one post, one page, and an archive. Test with the site’s canonical hostname and HTTPS scheme.
Visiting the Permalinks screen also flushes WordPress’s rewrite rules. A save is not required solely to perform that flush, although saving is appropriate when you have selected a new structure. If WordPress says that .htaccess is not writable, the screen displays the rules you need to copy into the correct file manually. The behavior and wording are documented in the Settings Permalinks screen reference.
Where each web server keeps the rewrite rules
| Server | Where routing is configured | Who normally changes it | Important limitation |
|---|---|---|---|
| Apache HTTP Server | .htaccess in the applicable document-root directory |
WordPress can write it when permissions and server policy allow; otherwise an administrator or host must do it | Rewrite support and directory overrides must be enabled |
| Standalone Nginx | Server-level configuration, usually a server block |
Server administrator or hosting provider | Nginx does not read per-directory .htaccess files |
| IIS | web.config and IIS URL Rewrite configuration |
IIS administrator or host | Apache snippets cannot be used as an IIS configuration |
The distinction is central: placing an Apache file on an Nginx server does nothing, and a valid Nginx rule cannot repair an IIS site. WordPress’s server references explain the platform-specific requirements for Apache, Nginx, and IIS and directory installations.
Apache: configure and verify .htaccess
Check that Apache can rewrite requests
Apache needs its rewrite functionality enabled, and the virtual host must permit the relevant directory to use overrides. The .htaccess file must be in the directory that serves the public WordPress installation, normally the document root. A file in the wrong directory can be perfectly formed yet have no effect.
Ask the host or administrator to confirm that the rewrite module is enabled and that the directory’s override policy allows WordPress rules. Shared hosting may expose only a file manager, while a managed server may require a support request.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Use the rules WordPress shows
When the Permalinks screen reports that the file is not writable, copy the displayed rules into the applicable .htaccess file using an administrator account or hosting file manager. Preserve existing directives that the host, security system, cache, or plugins require.
The basic WordPress pattern documented by the project looks like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
This is a model, not a universal drop-in replacement. A site installed in a subdirectory needs a matching base path and front-controller target. Multisite, reverse proxies, and host-specific security rules can also change the complete configuration. Compare your file with the rules shown by WordPress and the official Apache guidance rather than copying an unexplained forum snippet.
Confirm the result
After placing the rules, return to Settings → Permalinks, select the intended structure, and save. Request a known post in a fresh session. A successful response confirms that Apache passed the virtual path to WordPress; a 404 means either the rule is not being read, the request is reaching a different server layer, or the WordPress installation path does not match the rule.
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 problemsNginx: configure the server block, not .htaccess
Standalone Nginx has no per-directory .htaccess equivalent. WordPress cannot edit the Nginx configuration from the dashboard, so an administrator must update the site’s server block or the hosting provider must do it. Creating an .htaccess file on such a server will not remove index.php or fix a 404.
The common routing pattern in the WordPress learning material is:
location / {
try_files $uri $uri/ /index.php?$args;
}
try_files first serves an existing file or directory and then sends other requests to WordPress’s front controller while preserving query arguments. The example must be integrated with the actual document root, PHP-FPM handler, HTTPS and host rules, multisite requirements, and any reverse proxy. It is a discussion point for the server administrator, not a complete configuration to paste blindly. See WordPress’s Nginx guidance and the Apache and Nginx permalink lesson.
Once the administrator reloads Nginx safely, select the desired structure under Settings → Permalinks and test several URLs. If you do not have permission to edit the server block, provide the host with the site’s public root, WordPress installation path, desired structure, and examples of the failing and expected URLs.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →IIS and WordPress installed in a directory
IIS uses web.config and its URL Rewrite feature rather than Apache’s .htaccess. Follow an IIS-specific procedure for the site’s layout. Apache directives copied into web.config are not valid.
A related complication occurs when WordPress core files live in a subdirectory but the public site is served from another directory. In that arrangement, the public root’s index.php and rewrite configuration may need to point to the core directory. The exact paths depend on the installation, so use the official Giving WordPress Its Own Directory procedure and have the IIS administrator verify the resulting rule placement.
How to test the change without creating a larger outage
Use a small, repeatable test set instead of checking only the home page:
Rank #4
- Open the home page and confirm the canonical hostname, HTTPS, and page assets load.
- Open a recent post and an older post. Confirm that both clean paths resolve and display the expected content.
- Open a normal page, a category or tag archive, and any custom post-type archive the site depends on.
- Check feeds, XML sitemaps, navigation menus, and forms that generate links.
- Sign in separately and confirm
/wp-admin/, the login screen, and preview links still work. - Inspect the browser’s response status or server access log. A genuine 404 identifies routing or path problems; a redirect loop points to conflicting HTTPS, host, or proxy rules.
Test from a private window or clear the relevant site and reverse-proxy caches after the configuration is known to be correct. Cache clearing cannot substitute for a rewrite rule, but stale cached responses can hide a successful change or preserve an old 404.
Recommended Free Tools
Redirect the old URLs when the path has changed
Removing index.php changes the address of every affected post, page, or archive. Keep the old paths available through permanent redirects where they have inbound links or search visibility. Redirects should be implemented at the web-server or redirect-management layer appropriate to the site, with care not to create chains or loops.
Test representative old URLs directly. Each should reach the corresponding new canonical URL in one hop, while the new URL should return the content without redirecting back. Update internal navigation, XML sitemaps, canonical URL settings, feeds, and external integrations that your team controls. Monitor server logs and analytics for requests to the old pattern after deployment.
The precise redirect syntax depends on Apache, Nginx, IIS, the site’s subdirectory, and whether other redirects already exist. Do not paste a generic rule over a production configuration without a backup and a rollback plan.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting 404 errors after removing index.php
Restore the known-good structure first
If clean URLs fail across the site, return temporarily to the previously working permalink option under Settings → Permalinks. This limits the outage while you identify the server layer and configuration problem. Do not continue changing several settings at once.
Identify the actual request path
Determine whether traffic reaches Apache, Nginx, IIS, a reverse proxy, or a managed platform in front of WordPress. The rule must be installed at the layer that receives the request. A site can use Nginx as a proxy and Apache behind it, in which case both layers may matter.
Best Value
Check that the rule is active and in the right directory
- On Apache, verify rewrite support, directory overrides, file permissions, and the location of
.htaccess. - On Nginx, verify the active server block, document root, configuration reload, and the
try_filesroute. - On IIS, verify URL Rewrite and the applicable
web.config. - Confirm that the rule’s base path matches a root installation, subdirectory installation, or multisite network.
Compare WordPress’s generated rules
Open the Permalinks screen and compare the rules WordPress displays with the file or server configuration actually in use. If the file is not writable, the screen’s text is the authoritative starting point for that site’s selected structure. Preserve non-WordPress directives while correcting the routing portion.
Escalate when server access is unavailable
WordPress documentation notes that the hosting provider may need to configure the server. Send support the current and desired permalink structures, the web-server type, the public document root, an example URL that returns 404, and the exact time of a test request. A managed WordPress or hosting-support service can be useful when you cannot access server-level configuration, but it should be treated as qualified assistance rather than a guaranteed one-click fix.
Check layout and integrations
When only some paths fail, inspect whether WordPress core and the public document root are different, whether the site is multisite, and whether a plugin or integration constructs its own URLs. Test known posts, pages, archives, and any application that consumes the site’s links. Clear relevant caches only after routing is correct.
Common mistakes to avoid
- Changing only the dashboard option: WordPress can display the new pattern even when the server cannot route it.
- Using
.htaccesson Nginx: standalone Nginx ignores it. - Copying an Apache snippet into IIS: the syntax and configuration model are different.
- Replacing the entire configuration: unrelated security, proxy, cache, or redirect directives may be lost.
- Assuming every old URL will redirect: plan and test redirects explicitly.
- Testing only the home page: front-page routing can work while posts, archives, or subdirectory paths still fail.
- Ignoring installation layout: root, subdirectory, and multisite paths require different rule placement.
Choosing a durable permalink structure
Removing index.php does not require changing every other part of the URL policy. Choose the simplest structure that matches the site’s established links and editorial needs. A post-name pattern is short and readable, while date or category segments may be important to an existing archive system. Stability matters more than cosmetic brevity: avoid repeated migrations unless there is a compelling reason.
Document the selected structure, the server rule location, the redirect policy, and the test URLs. Keep that record with the site’s deployment notes so a future host migration or server rebuild does not reintroduce Almost Pretty permalinks.
Bottom line
Remove /index.php/ by selecting the intended structure in Settings → Permalinks and pairing it with the correct rewrite configuration for Apache, Nginx, or IIS. Back up first, preserve existing server directives, test posts and archives—not just the home page—and redirect old paths when they have already been published. If you cannot edit the server configuration, the host must install or enable the required rules.
Quick Recap
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.

