Answer the question
In order to leave comments, you need to log in
What is the correct way to write mod_rewrite for SPA?
How to correctly write a rule for .htaccess so that when you access a link of the form /pages/page1/
(any combination can be) a file is opened app/index.html
, and if there is a parameter at the end, ?_escaped_fragment_=
then open the page `snapshot/pages/page1/index.html`
For example /page-test
Leads to app/index.html
A if
For example /page-test?_escaped_fragment_=
Leads to snapshot/page-test/index.html
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
RewriteCond %{QUERY_STRING} (^|&)_escaped_fragment_=($|&)
RewriteRule ^(.*)$ /app/index.html? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question