admin管理员组文章数量:1289636
I am testing the integration of a VueJS app in WordPress. It actually works (no styles yet).
BUT
If I access a URL like , the
.htaccess
URL rewriting redirects any incoming HTTPS request to the index.php
of WordPress. So I actually never land on /my-vue-route/about
but on the /about
page, as WordPress thinks I made a typo.
Is it somehow possible to keep the vue routes out of this URL rewriting?
I am testing the integration of a VueJS app in WordPress. It actually works (no styles yet).
BUT
If I access a URL like https://example/my-vue-route/about
, the .htaccess
URL rewriting redirects any incoming HTTPS request to the index.php
of WordPress. So I actually never land on /my-vue-route/about
but on the /about
page, as WordPress thinks I made a typo.
Is it somehow possible to keep the vue routes out of this URL rewriting?
Share Improve this question edited Apr 14, 2019 at 15:15 norman.lol 3,2313 gold badges29 silver badges35 bronze badges asked Apr 14, 2019 at 13:20 DudiDudeDudiDude 1312 bronze badges 01 Answer
Reset to default 1This 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
本文标签: WordPress and VueJS routing problem
版权声明:本文标题:WordPress and VueJS routing problem 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741442958a2379024.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论