D
D
Denis Bukreev2016-11-10 05:16:07
JavaScript
Denis Bukreev, 2016-11-10 05:16:07

How to properly configure .htaccess for history API?

So it goes.
Using the history API, for example, flowers will be generated for me.
Those. when clicking on some flower on the main (/) the link will look like this: /flowers/rose
But what to do with .htaccess? After all, when you click on such a link, the server will try to return a page that does not exist.
In general, all /flowers/***** should be redirected to the home page, but the address is saved
. How to set up .htaccess in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lnked, 2016-11-10
@lnked

RewriteEngine On
RewriteRule ^(.*)$ index.php [L,QSA]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question