D
D
Denis Bukreev2017-04-21 15:16:39
Apache HTTP Server
Denis Bukreev, 2017-04-21 15:16:39

How to configure htaccess redirect to one page, but with saving the address?

So it goes.
I need this for react, so that index.html always opens, and all address parameters remain for reading.
I googled the express setup, webpack-server, and apache seems to be not used anywhere.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Bukreev, 2017-04-21
@denisbookreev

<IfModule mod_rewrite.c>
    RewriteEngine on

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.html [L]
</IfModule>

I'm not sure about the relevance of this code, but it works. There is probably a better setting.
I took this code directly from Laravel's htaccess

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question