WordPress and VueJS routing problem

This is the default WordPress .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Please add add the following line to it to prevent the default behavior for your custom route.

RewriteCond %{REQUEST_URI} !^/my-vue-route/(.+)

Like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/my-vue-route/(.+)
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Leave a Comment

tech