2

.htaccess RewriteRule code:

RewriteRule ^urunler/([0-9a-zA-Z-_]+)/([0-9]+)/?$  urunler.php?kategori_id=$1&page=$2 [L,QSA]

I am going to this url "example.com/urunler/hi-tech-cadirlar/1".There is an error in this URL. But "example.com/urunler/hi-tech-cadirlar" this url go to 404 not found page. I can not make pagination. I dont want the error Empty paramters.

1 Answers1

0

You can use two different rules, one for pagination and another without pagination:

RewriteRule ^urunler/([\w-]+)/?$  urunler.php?kategori_id=$1&page=$2 [L,QSA,NC]

RewriteRule ^urunler/([\w-]+)/(\d+)/?$  urunler.php?kategori_id=$1&page=$2 [L,QSA,NC]
anubhava
  • 761,203
  • 64
  • 569
  • 643
  • 1
    @anubhava Dear If you have a time can you check my question for me ? [LINK](http://stackoverflow.com/questions/38020054/remove-php-extension-from-subfolder-url) – AlwaysStudent Jun 24 '16 at 18:44