0

I'm trying to use the url_rewrite system for php but, as i'm a rookie i have a conflict problem (i suppose) between rules.

I have these three htaccess rules. The first two are working, the last one not.

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)\.html$ /site/product.php?cid=$1&n=$2 [L]

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /site/product-detail.php? 
cid=$1&pid=$2&n=$3 [L] 

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)\.html$ /site/news-full.php?id_news=$1&nw=$2 [L]

This is how the link is set on my php page:

 <a href="<?php echo WEB_ROOT.$id_news."/".$name_news; ?>.html">

when i load the page, i don't have any data print on page. i tried to use also prefix but doesn't work

What can i do? Thanks

Ogum
  • 101
  • You have the **same URL** path "`^([^/]*)/([^/]*)\.html$`" in both RewriteRule's and you can only rewrite the URL to one target at the same time – HBruijn Jan 18 '19 at 11:19
  • i tried to add a prefix ^news/(.*)/(.*).html$ /site/veneta-sali-news-full.php?id_news=$1&nw=$2 [L] but it doesn't work – Ogum Jan 18 '19 at 13:16

0 Answers0