If you want to remove the index.php
from your URL structure, then using this rewrite rule (assuming you’re using Apache, from your question) in your .htaccess will help.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Then, flush permalinks by either using WP-CLI and running wp rewrite flush
, or visiting the Permalinks settings page and clicking the save button. You don’t need to make any changes before saving, but if you want to be sure to use just the post slug, click that radio option first, then save to flush permalinks.
Related Posts:
- After moving from subdirectory to home, home page does not display
- Problems redirecting to “pretty” permalinks (wordpress in Subdirectory)
- AWS WordPress Install – pages/posts 404 on restart until updating permalinks
- WordPress 404 in development area
- Custom Permalink
- Page preview is shown, updating page gives 404 error
- Accessing Subdirectories in WordPress Install
- old permalinks not found
- LetsEncrypt WordPress on the Raspberry Pi – Nice url’s give 404 with https, http works
- When using number in url it is redircting to same page but when using character it redirects to 404
- Folder Name and Category Name WordPress
- Setting up WordPress with Custom Permalinks and no .htaccess File?
- Setting 404 page in Nginx
- Passing variables through permalink structure
- WordPress on a subdirectory of Laravel – WordPress pretty permalinks inner page shows laravel
- Remove subfolders from URL
- 404 on category.php pagination
- htaccess or redirect to cloak portion of a link?
- Posts not working on windows after changing permalinks
- wordpress permalinks tweeks
- Getting a 500 internal server error ONLY on wp-admin/options-permalink.php
- Redirect old permalinks with Month and name to Post name on new site
- .htaccess – Redirect duplicated post ended in ‘-number/’ to the same url without the -number/
- Specific URL Rewriting with parameters in wordpress
- Permalink /%category%/%postname%/ returns 404 on OSX
- Permalinks keep reverting to 404 unless I re-save them
- .htaccess file missing from WordPress install directory
- Permalinks okay some pages but 404 error on others
- Changes to .htaccess not updating the file (old rules still take effect)
- If I change permalink structures, can I use htaccess to permanantly redirect links?
- Redirect parent taxonomy to it’s child
- Permalinks not working with Vagrant
- How to redirect to correct pages after permalink structure change
- Moving local wordpress page to a real server subdomain broke my permalinks?
- 404 Error Problems with sCategory Permalink plugin
- Only plain permalinks working
- How to change old permalink?
- Redirect Uploads Folder to Query Vars in WordPress
- flush_rewrite_rules breaks permalinks
- Correct permalinks and 404-error
- What would cause a theme to add extra characters to blog post links?
- Permalink Doesnt Work – URL Not Found
- Getting 404 when Access post which name start with Digit
- WordPress 4.4 old permalink redirect
- 404 when going to /blog
- Permalinks 404 error with HTTPS host
- Htaccess https 301 problem
- Empty permalinks settings in .htaccess
- How to rewrite a URL to another rewritten URL without changing the address?
- How to use different domains for different blogs hosted in the same host in subdomains with .htaccess
- WordPress 3.1 .htaccess contents keep dissappearing?
- Custom permalinks in WordPress
- What causes /pages/ to appear in URI, and how to remove it?
- Permalinks on post is working, on pages 404 error
- Changing WordPress routing to load the same page for different URLs
- Some Pemalink problems, probably caused by wrong .htaccess configuration?
- 404 permalink errors on Pages only
- change WordPress permalinks and redirect new urls 301
- Home page Pagination – Other pages do not redirect to home page template
- WordPress Page Not Found if Permalink Settings is Postname
- Conditional Permalink based on category?
- Why does enabling Permalinks make pages not found?
- Changing permalink settings causes 404
- Main blog page works but title says Page not found
- WordPress permalink change causes all incoming links to give 404 errors
- Problems with permalinks (.htaccess not working)
- using wp_redirect to redirect to a permalink
- The requested URL was not found on this server [closed]
- What would cause a 500 Server Error with permalinks turned OFF?
- Browsing to permalink prefix results in 404
- Change author permalink using htaccess?
- Xampp 7.3.3 fresh install of WordPress 404 pages unless permalink is set to plain
- MySQL-inserted custom taxonomy term lead to 404, flush rewrites doesn’t help
- Woocommerce posts and products links works only once and then get 404 error
- Extending page urls without getting a 404
- Cannot publish posts or pages when I change permalink structure
- 404 on pretty permalinks when serving via HTTPS
- Permalink issue with WordPress Site at domain root and another WordPress Site in a Subfolder
- 404 page not found – Yet open admin page it works
- Custom permalink gives 404 error only in some pages
- Remove Permalink of certain posts
- wordpress admin panel loop on nginx
- Problem with permalinks
- Very strange behaviour related to htaccess and custom posts and custom posts substrings (BUG?)
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- WordPress All pages but home simply read “hello”
- WordPress pages break with custom permalink settings (theme directory not output)
- How to rewrite a folder in WordPress?
- On IIS, stop WordPress from resaving my web.config file when I enter the Permalinks config page
- Can’t access WordPress site in subfolder possibly because of .htaccess redirect from root installation?
- Pretty permalinks (again)
- Fresh wordpress installation in sub-directory not accessible
- .htaccess not working in WordPress
- 404 error on second page load for child-pages
- redirect old pages by .htaccess
- WordPress 3.1 problem, getting 404
- htaccess strip url
- WordPress Permalinks 404 Not Found
- 301 Redirect posts to newly added categories
- Standard Htaccess directives disappear by themselves