.htaccess rewrite url with two variables .htaccess rewrite url with two variables wordpress wordpress

.htaccess rewrite url with two variables


Try this and let me know if it works for you (updated),

 RewriteEngine On RewriteCond %{THE_REQUEST} ^GET\ /film-al-cinema\/\?titolo=([^\s&]+)&id=([^\s&]+) [NC] RewriteRule ^film-al-cinema\/$ /film-al-cinema/%1/%2? [R,L] RewriteRule ^film-al-cinema/([^/]+)/([^/]+)/?$ /film-al-cinema/?titolo=$1&id=$2 [NC,L]

You should create a backup of your current .htaccess file and then use this code.If everything works fine add R=301in place of R in the last line