Anuar Alfetahe
Anuar Alfetahe

Reputation: 79

.htaccess redirect with dynamic get parameters

I would like to redirect all users from path /et/{wildcard} to path /direct.php?path=wildcard_value currently i have this but this is not dynamic nor it is any passing get parameters.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
    RewriteCond %{REQUEST_URI} ^/et
    RewriteRule (.*)$ http://www\.mysite\.com/direct.php [R=302,L]
</IfModule>

Upvotes: 0

Views: 83

Answers (1)

Sami Ahmed Siddiqui
Sami Ahmed Siddiqui

Reputation: 2386

This code should work for you. RedirectMatch 301 /et/(.*) https://example.com/direct.php?path=$1

Upvotes: 1

Related Questions