How to rewrite below urls patterns to specific php files using htaccess?
With your shown attempts/rules please try following rules in your .htaccess file. Please make sure to clear your browser cache before testing your URLs.
RewriteEngine ON##Rules for handling https://www.example.com/my-dynamic-category/ RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^([^/]*)/?$ category.php?p=$1 [L]##Rules for handling https://www.example.com/my-dynnamic-category/my-dynamic-url-id/RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^([^/]*)/(.*)/?$ detail.php?p=$2 [L]