gilbitron/wp-rest-theme

Visiting a post permalink directly tries to redirect it

JJJ opened this issue · 0 comments

JJJ commented

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' );