I’m trying to do some htaccess redirects for cleaner URL’s, but I failed to do.
Here is my intend:
/kitap/blah => kitap.php?a=blah
/kitap/blah-123 => kitap.php?a=blah&b=123
This is my current code.
RewriteRule ^(kitap|yazar)/?([^/\.]+)?(-([0-9]+))?/?$ $1.php?a=$2&b=$3 [QSA,L,NC]
Currently it producing this:
/kitap/blah => kitap.php?a=blah
/kitap/blah-123 => kitap.php?a=blah-123
The word “blah” can include Unicode characters, like ç,ö,ğ,ş etc. (This means [a-z0-9_] will not work in my situation)
How can I accomplish my intended result? I tried various things but no success. Thanks.
I ended up with a “hybrid” solution from Alin and battal’s comments.
And it works.
Thanks!