DEV Community

Angelo Mantellini
Angelo Mantellini

Posted on

redirect with parameters

Hi, i'm trying to setup apache2 to serve a gatsby webapplication.
I need to use a dynamic webpage and I obtain a fast error 404 with an automatic redirect to this page.

I'm trying to configure apache with the following snippet of configurition.

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/auto
    RewriteRule (.*) /auto/ [QSA,L]
Enter fullscreen mode Exit fullscreen mode

It works, but i need to redirect the parameters, too.
The problem is about the canonical url after the redirect

the input is https://example.com/auto/alfaromeo (alfaromeo is a parameter), the canonical url is
https://example.com/auto/
How can I add the parameter?

how can I solve it?

Thanks a lot
Angelo

Top comments (0)