I want to rewrite a dynamic url coming from submit form:
this is the code of form submit:
the correspond url is: mondomain/search.php?id_ac=23
i want to rewrite this to mondomain/23
any help please.
I want to rewrite a dynamic url coming from submit form:
this is the code of form submit:
the correspond url is: mondomain/search.php?id_ac=23
i want to rewrite this to mondomain/23
any help please.
You can use:
RewriteCond %{THE_REQUEST} \s/+search\.php\?id_ac=([^&]+)&id_de=([^\s&]+) [NC]
RewriteRule ^ /%1-%2? [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^-]+)-([^/]+)/?$ /search.php?id_ac=$1&id_de=$2 [L,QSA,NC]