The reason that’s happening at all is because of content negotiation. /2011.html
wouldn’t normally be accessible through /2011/
, but content negotiation is making Apache automatically look for files named 2011
(whatever the extension) when it can’t find the folder before it passes control to WordPress.
This can be quite useful, but if you don’t particularly need content negotiation (WordPress itself doesn’t need it), you can turn it off by adding this to your .htaccess
:
Options -MultiViews
If that doesn’t work, or you do need content negotiation, you could rename the 2011.html
to something else, and use mod_rewrite to make sure the link still works. E.g. rename 2011.html
to happynewyear.html
and then add this to your .htaccess
(before the other RewriteRules):
RewriteRule ^2011\.html happynewyear.html [L]
Related Posts:
- remove “index.php” from permalinks
- Change author permalink
- How to remove dates from existing permalinks?
- “.#[random-char-string]” being inserted at end of URLs
- mod_rewrite enabled but Permalinks show index.php
- WordPress on a subdirectory of Laravel – WordPress pretty permalinks inner page shows laravel
- How to map permalinks with accented letters to sanitized slugs?
- Without index.php in permalinks I get 404 across site
- add new permalink structure from dynamic page
- WordPress Permalinks still not working despite all necessary settings
- Server Move: All pages leading home
- Only default permalink is working mod_rewrite enabled
- How to remove specific category from URL in WordPress
- permalink results to “page not found”
- mod-rewrite exception? keep #hash in matching urls?
- .htaccess rewriterule being ignored – tyring to remove dates from WP posts
- Can’t get permalinks working!
- Permalink sub-routing catch-all
- Permalinks not working in WordPress
- WordPress Page Not Found if Permalink Settings is Postname
- Access posts while mod_rewrite is broken
- mod-rewrite rules grabs “broken permalinks”, too
- Need to capture “keyword” added to the end of the post, even with “pretty permalinks”
- Already have htaccess but permalink settings not working. Getting 404
- Changing permalink stops me from creating webpages
- How can I put WordPress in a directory but keep just the home page at the domain root?
- How to change permalink structure and keep permalinks for old posts
- Pretty permalinks (again)
- Only homepage working correctly, 404 error on everything else
- customize urls displayed by previous_post_link and next_post_link
- .htaccess not working in WordPress
- WordPress home page showing 404 error
- how to create several url aliases for a page
- Permalinks is not working in my wordpress setup
- Settings > Permalinks – mod_rewrite ineffective if expression not preceded by /index.php/
- Is it possible to get a page link from its slug?
- Need help with add_rewrite_rule
- After server migration only the homepage works
- where is permalink info stored in database?
- Changing permalinks gives me 404 errors on nginx
- How do I add /blog/ as a prefix to permalink structure for blog posts, tag pages, etc.?
- Change media item permalink
- Get Permalink without domain (i.e. get relative permalink) [duplicate]
- How does WordPress create URLs that Apache knows about?
- Strange permalink issue: can’t rename /company-2/ to /company/
- Passing and retrieving query vars in wordpress
- Get the current page URL (including pagination)
- Stop WordPress appending `-2` to the end of my url after i change it
- Get default permalink structure from pretty URL’s
- How to get permalink and title from post ID?
- Why is “/page/2/” not working?
- WordPress Permalinks not working in Apache2 Ubuntu 14.04
- Performance of my permalink structure?
- Permalink format: singular or plural
- What is the difference between get_post_permalink and get_permalink?
- WordPress matching URLs with trailing tildes
- Get current URL (permalink) without /page/{pagenum}/
- How does WordPress handle permalinks?
- Pretty permalinks for search results with extra query var
- Get page permalink without wpurl
- How can I get the privacy policy page?
- Can I use REST-API on plain permalink format?
- WordPress slug issue with non-latin characters
- Change permalinks for posts but not for custom post types
- Rewrite Rule for Multilingual Website, Like qTranslate?
- How to get pretty URLs with add_query_arg in permalinks
- What is the best permalink structure for SEO?
- Creating custom permalink structure for languages
- Hide permalink and preview button and link on custom post
- Custom post type permalink endpoint
- How can I make Capital letter ( upper-case ) permalinks?
- How can I reverse engineer a Permalink to Find the Page?
- Mapping Domains to Permalinks (not multisite)
- How do I set a custom base URL for standard posts?
- Removing Parent Page(s) from Permalink
- Why permalinks work with /index.php/%postname% but not with just %postname%?
- Setting up WordPress with Custom Permalinks and no .htaccess File?
- Getting the Site URL Including the Front Base
- Does WordPress Change the .htaccess File When Updating?
- Using $_GET variables in the URL?
- Removing the redirect after changing a page’s slug
- How to display a public profile page for registered users with custom slug?
- Removing leading zeros from custom permalink structure
- Must slugs be unique?
- Setting 404 page in Nginx
- How to get the clean permalink in a draft?
- How to use relative links on my pages?
- How does wordpress keep track of post id when post id is not used in permalinks?
- How to filter to output of the get_permalink() function
- Stop WordPress from reserving slugs for media items?
- Including category-base in a post permalink results in 404
- How to change ‘with_front” key from an existing custom post type?
- Change slug on post creation
- Does WordPress automatically do 301 redirect if I change permalink
- How can I store page ID in a post instead of other selected permalink?
- WordPress Permalink changes to question mark (?) in URL
- WordPress thinks my custom route is a 404
- Prevent WordPress from abbreviating-long-slugs…-in-the-admin
- Adding another word in front of post url
- Permalink with sub-sub-category and post name