I managed to get it working by placing the following in an .htaccess file in my React app folder:
<IfModule mod_rewrite.c>
RewriteEngine on
# Don’t rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.html [L]
</IfModule>
Also WP custom permalinks work as well.
Related Posts:
- Stop WordPress appending `-2` to the end of my url after i change it
- WordPress Permalinks not working in Apache2 Ubuntu 14.04
- Get current URL (permalink) without /page/{pagenum}/
- How to get pretty URLs with add_query_arg in permalinks
- Removing the redirect after changing a page’s slug
- How to display a public profile page for registered users with custom slug?
- How does wordpress keep track of post id when post id is not used in permalinks?
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- How to add query parameters to all internal links?
- How to make draft posts or posts in review accessible via full url / slug?
- nginx – permalinks with .php in url not working
- Social Media Links on homepage – within posts/post loop
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- removed index.php now all pages 404
- How to change the link structure of the homepage?
- Permalinks all messed up, I am helpless [closed]
- Remove words from permalink when saving post automatically?
- WordPress | Convert #038; to &
- permalink changed, now getting 404 for every pages
- How to write correct add_rewrite_rule in WordPress for more than one taxonomy in one rule?
- How to add category to the permalink and breadcrumb?
- Rewrite my default post URL
- Get permalink to page?
- Parent Category link to its sub categories on different page
- How can I link a file in admin with a button?
- Remove Dash/Hyphen From WordPress CustomPosttype Permalink
- Auto-create a pretty permalink for a bunch of posts
- Permalinks: Page Not Found
- wp_logout_url redirects to incorrect page because of pagination
- how to add rewrite rule to wordpress default post type
- Moved page (new parent) loads properly using obsolete URI. Why?
- Only default permalink is working mod_rewrite enabled
- Is a permastruct possible on pages?
- Custom WordPress user permalink
- Custom Permalinks for Posts only
- How to add a variable as a tag base?
- WPML – how to get the permalinks to display also the default language
- Custom permalink structure for posts in specific category
- Removing leading zeros from custom permalink structure
- WordPress url ingore permalinks setting [closed]
- Integrating wordpress into existing site and setting up htaccess?
- Permalinks stopped working – NO update, mod_rewrite enabled, .htaccess not touched
- Add more structure tag to permalink?
- wp_publish_post to saved draft, permalinks broken
- display dynamic content based on url slug on custom page
- How to generate a list of all urls
- Let me choose permalinks
- All URLs are having ‘/blog/’ appended to them.
- Slugs Disappeared Leaving 404s – Quick way to repopulate?
- Path to Pages Resolves to Archive instead of Actual Content
- permalink %year% of pre-written posts to be published next year, in the mysterious future (*)
- Changing permalink name redirects to another template?
- Permalink slug no longer editable when using post_type_link filter
- Changing the permlink and SEO
- whats the mistake → href=”get_permalink() [closed]
- Remove some rewrite rules in wordpress
- Test site pages go to main site
- How to change permalinks
- WordPress pages and posts are redirecting to server IP address instead of domain URL [closed]
- Would it be wrong to save the permalinks as a postmeta and regenerate it on save post? [closed]
- How to: change permalink by category?
- Rewrite rule not passing variable
- new page redirect to old page which had the same permalink
- Edit permalink for old posts and not show on top of RSS feed
- Long permalinks get split with multidots and get broken
- Page content doesn’t display when published but does when previewed as draft?
- Will permalinks work if blog is transferred to subdirectory?
- function to set permalink to /%postname%/ on theme activation
- How to remove slug from front page?
- Find all URLs for a post
- Homepage template and url changed?
- How to separate an overgrown blog into sub-blogs – without breaking existing inbound links?
- Using a template file for a specific custom URL
- Passing parameter through permalink structure
- Add word to permalinks does not transform the urls
- Change permalink structure
- Permalinks don’t update nor link properly
- Getting 400 Bad request Error when trying to open posts after updating to wordpress 5.0
- Category Base permalinks
- Pretty Filter URL
- get_permalink to an anchor
- 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
- Add Custom Pagination Permalink
- Prevent guessing slug
- Pretty permalinks to work for lighttpd webserver?
- Pages included in another page and duplicate content issues for SEO
- Customize category permalinks
- WordPress archive posts returns user to homepage
- broken permalinks in responsive layout
- URL to an image in a post is changing when permalink is set to custom. Can I avoid this?
- How can i edit all posts slug in bulk keeping WP native redirect?
- permalinks url with woocommerce
- Blog url disappears
- Not recognizing my custom templates in hierarchy
- Add additional URL variations for a Post
- How to use ‘blogs.dir’ as media upload instead of ‘uploads’ directory in WordPress multisite setup
- How to make my custom permalink pull up the correct post
- How to Set Both Category and Sub-Category Level at Root. It should also obey post rule as /category/sample-post and /sub-catgeory/sample-post?