OK fixed it!
I had some errant lines in the .htaccess file:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# WP REWRITE LOOP END
This was taking precedence over the <IfModule mod_rewrite.c>
block – and explains why it was redirecting to the parent directory.
(The lesson here is if you are asking for questions about .htaccess, it is probably good to post the whole .htaccess file rather than just a snippet!)
Related Posts:
- Need help with add_rewrite_rule
- How to get pretty URLs with add_query_arg in permalinks
- How does wordpress keep track of post id when post id is not used in permalinks?
- Prevent WordPress from abbreviating-long-slugs…-in-the-admin
- Page begins with number, WordPress adds 2
- Permalinks to Custom does not work (out of box)
- Why don’t WordPress post slugs allow accents?
- Multi-language permalink in qtranslate
- How to add query parameters to all internal links?
- How to make draft posts or posts in review accessible via full url / slug?
- Modify get_permalink with a specific filter
- Social Media Links on homepage – within posts/post loop
- How to set permalink to fetch all children custom posts with parent post in wordpress?
- How to change the link structure of the homepage?
- WordPress on VirtualBox – no pretty permalinks
- permalinks has -2 with post name structure. why?
- Child pages with same slug
- Permalinks, Rewrites, Get Variables, Oh My!
- Remove words from permalink when saving post automatically?
- Permalink problem
- How to add category to the permalink and breadcrumb?
- Rewrite my default post URL
- Removing leading zeros from custom permalink structure
- Get permalink to page?
- Parent Category link to its sub categories on different page
- How to reset canonical URLs / fix redirect loop
- Permalinks: Page Not Found
- Trailing slash at the end of permalink loads faster / better SEO?
- How to link to current post in WordPress?
- wordpress api using rest_route for other pages
- Infinite redirects after changing the permalink of a page
- 301 Redirects Result in 404 for WordPress Search Query Strings
- After updating to 4.8 permalinks will not work (all 404)
- Remove custom taxonomy base from URL
- How to get post object on blog template
- Editing URL character replacement
- How to make /search/ without parameters not return a 404?
- WordPress auto generates small medium and large of an image on upload, how can we guess their links?
- Get post text (by its URL) from database dump
- Plain to postname permalinks not working
- WordPress archive permalink with leaf category
- Google webmaster duplicate url issue with /page/01 /page/400
- URL rewriting: removing the site’s basename for a specific category
- Migrated from Windows to Linux. Any bulk methods for fixing case sensitivity?
- All top-level pages are using index.php as template
- Redirect all posts permalinks from “.html” to “/”
- Unable to get /%postname%/ permalinks working, 404 on all links
- How to rename ‘Tag Base’ with WPeC 3.8?
- Custom rewrite rule ignored
- Stop Images Linking to Themselves?
- Resolve 404 on posts without category
- Inserting a string in the middle of page’s permalink?
- When I click on a single post my browser goes to about:blank#blocked and the page is white
- 404 on internal pages, in all sites in my local server
- how to alter permalink in wordpress?
- Pagination using paginate_links
- add_rewrite_rule – Page Slug from “/foo-bar/” to “/foo/bar/”
- Permalink will not change – it wants to have -2 slug [duplicate]
- Permalinks 404 after Subdirectory to Root Migration
- Access or edit custom generated permalinks with WP_Rewrite
- Add custom query vars to pretty permalinks
- xammp server permalink by postname not working
- Redirect after permalink changes
- Custom permalink structure only saves with index.php inserted
- the_permalink() not working
- Permalinks and page store
- All in One Seo and Permalinks
- Already have htaccess but permalink settings not working. Getting 404
- Add .html permalink to post if specific category
- rewrite based slug standar post wp
- How to update wordpress permalink structure with author role?
- How to turn a custom query string into permalink?
- How can i fix my permalinks?
- Site Tagline ended up in permalink
- Custom structure permalink preventing 404
- Flush rewrite rules with scheduled event (cron)
- I have a 404 error on all my pages! What do I do?
- Add slug to default post permalinks ONLY
- Getting 400 Bad request Error when trying to open posts after updating to wordpress 5.0
- Category Base permalinks
- Propper way to set anchor and url param
- Do shortcodes in title before permalink is generated
- Pretty Filter URL
- Add URL to selected post in meta box
- How to change dynamic link to relevant post
- Auto-generated pretty permalink not using title since 4.4 update
- Problems with permalinks after update wordpress 4.2
- Pretty permalinks to work for lighttpd webserver?
- Customize category permalinks
- Latin character conversion
- Update permalinks
- Losing the original URL when using add_rewrite_rule
- broken permalinks in responsive layout
- permalinks url with woocommerce
- How to get the perfect WordPress, WooCommerce, Custom Post Type pretty permalinks?
- WordPress keep redirecting me to random URLs
- Not recognizing my custom templates in hierarchy
- How to make a permalink variable %year% become two digits instead of four digits?
- Custom Permalink Structure For a Specific Category
- Error: “Sorry, this content could not be embedded” when using the Embed block