wp-rest-theme icon indicating copy to clipboard operation
wp-rest-theme copied to clipboard

Visiting a post permalink directly tries to redirect it

Open JJJ opened this issue 8 years ago • 0 comments

When visiting a post permalink directly, it tries to redirect to the actual URL for the post rather than just the slug. This breaks the app in a weird way, because WordPress rewrite rules don't match the Vue routes.

I.E. Visiting src.wordpress-develop.dev/hello-world ...tries to redirect to... src.wordpress-develop.dev/2016/11/21/hello-world ...and then you're presented with a blank page.

Recommend to add this to functions.php so post-permalinks don't try to redirect:

add_filter( 'redirect_canonical', '__return_false' );

JJJ avatar Nov 21 '16 20:11 JJJ