0

I need to rewrite some URLs using a regular rule in htaccess, in order to rewrite all the URLs of that kind. Actual URL:

http://www.example.com/pippo-e-pluto?shopid=1000&shopname=Apicella&citta=Milano

Desired URL:

http://www.example.com/Apicella-Milano-1000

I have added this rule to .htaccess

RewriteRule ^/%2-%3-%1? /pippo-e-pluto?shopid=$1&shopname=$2&citta=$3 [L]
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
RewriteCond %{QUERY_STRING} ^shopid=(.*)&shopname=(.*)&citta=(.*)
RewriteRule ^pippo-e-pluto$ /%2-%3-%1? [R=301]

BUT it doesn't seem to work. My non SEF url is still the same. I'm using Joomla 3.6.4, mod_rewrite is on. Also asked for support to the hosting service but they couldn't fix this issue. Thank you very much!

Gix
  • 1
  • 2
    Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – Amit Verma Jan 23 '17 at 17:24

1 Answers1

0

Try this to make your SEF URLs work:

RewriteEngine on
RewriteRule ^([^/-]+)-([^/-]+)-([^/-]+)$ pippo-e-pluto?shopid=$2&shopname=$3&citta=$1
Nigel B. Peck
  • 5,804
  • 2
  • 16
  • 38