skip to Main Content

I am trying to write SEO friendly URL of below URL.

www.url.com/item.php?id=_84_113_112&lang=en

I have written below code:

RewriteRule ^(.*)/(.*)/$ item.php?id=$2&lang=$1 [QSA,L]

But not working, can anyone help?

2

Answers


  1. Probably extra / at the end (before $) is the problem.
    Change it to like this.

    RewriteRule ^(.*)/(.*)$ item.php?id=$2&lang=$1 [QSA,L]
    
    Login or Signup to reply.
  2. You can use this –

    RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ item.php?id=$1&lang=$2
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search