I wish to create URL re-write rules for following URL in htaccess.

http://example.com/vedios/category/fun/ -> http://example.com/vedios/category.php?cat=fun

http://example.com/vedios/category/fun/?show=popular -> http://example.com/vedios/category.php?cat=comedy&show=popular

http://example.com/vedios/category/fun/?show=popular&page=2 -> http://example.com/vedios/category.php?cat=comedy&show=popular&page=2

http://example.com/vedios/category/fun/comedy/ -> http://example.com/vedios/category.php?cat=comedy

http://example.com/vedios/category/fun/comedy/?show=popular -> http://example.com/vedios/category.php?cat=comedy&show=popular

http://example.com/vedios/category/fun/comedy/?show=popular&page=3 -> http://example.com/vedios/category.php?cat=comedy&show=popular&page=3

I attempted RewriteRule category/([^.]+)/?([^.]+)$ /vedio/category.php?cat=$1&$2 for http://example.com/vedio/category.php?cat=fun&show=popular&page=1 nevertheless its no longer working.

Please let me know what is the right URL re-write rules for that above needs?

The totally not area of the URL path that’s checked inside the RewriteRule directive. You'd require a RewriteCond directive to achieve that.

But you need to simply set the QSA flag to obtain the initial query string appended towards the brand new one:

RewriteRule category/([^.]+)/$ /vedio/category.php?cat=$1 [QSA]

My regexp for category script:

/vedio/category/([^.]+)/\?([^.]+)$

It is dependent if mod_rewrite is evaluating all of your URL (server + port + path) or simply the road to your script.