php - Static url does not redirect to the requested page -
i have question regarding .htaccess file.
have rewritten dynamic url in static 1 following: www.mysite.com/index.php?lang=it
in www.mysite.com/it
using rewrite rule:
rewriteengine on rewriterule ^it/([^/]*)\.html$ /index.php?lang=$1 [l]
so far good...
now need create static url dynamic url redirects product description www.mysite.com/product_details.php?id=1485
the rule inserted in .htaccess is:
rewriteengine on rewriterule ^it/prodotto-([^-]*)-([^-]*)\.html$ /it/product_details.php?id=$1&lang=$2 [l]
unfortunately if click on related link cannot reach requested page; if comment first rule this
#rewriterule ^it/([^/]*)\.html$ /index.php?lang=$1 [l]
then can see page. know how solve issue?
assuming lang equals language want script so?
rewriteengine on rewritebase / rewriterule ^it/([^/]*).html$ /index.php?lang=$1 [l] rewriterule ^it/prodotto-([^/]*)-([^/]*).html$ /it/product_details.php?id=$1&lang=$2 [l]
this do
yoursite.com/it/$1.html
and
yoursite.com/it/prodotto-$1-$2.html
?
Comments
Post a Comment