htaccess不会在子目录(apache)中工作

recently I have set up this rule to redirect my root hosting dir to a /test subdirectory

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.net$ [NC]
RewriteRule ^((?!test/).*)$ test/$1 [L,NC]

it is working fine...

So in that /test subdirectory, I have a file 'jokes.php' with these unfriendly URLS

//Jokes mainpage
www.mydomain.net/jokes.php
//Drunk jokes category
www.mydomain.net/jokes.php?c=drunks
//See 'On the bar' joke - this is how i identify on my DB
www.mydomain.net/jokes.php?c=drunks&id=on_the_bar

The above urls work fine...so I want to use Friendly URLs like this:

// Individual -> mydomain.net/jokes-drunks/on-the-bar/
RewriteRule ^jokes-(.*)/([a-zA-Z0-9-]*)/$ jokes.php?c=$1&id=$2
// Category -> mydomain.net/jokes-drunks/
RewriteRule ^jokes-([a-zA-Z_]+)/$ jokes.php?c=$1
// Main -> mydomain.net/jokes/
RewriteRule ^jokes/ jokes.php

But i get a 404 error all the time. The rewrite rules works fine on Localhost, same site structure /root/site ... I have to mention my localhost .htaccess file is in /test subdirectory but in mydomain.net is in the root, cuz that way it works for the first redirection rule... of course my site is in /test subdir too...

I've tried to use another .htaccess file inside /test subdirectory but I think the Root .htaccess overrides the subdirectory .htaccess or something...

Im learning so be patient :) thanks in advance

Try adding Flags to your rules :

RewriteRule ^jokes-([^/]+)/([a-zA-Z0-9-]*)/?$ jokes.php?c=$1&id=$2 [QSA,NC,L]
RewriteRule ^jokes-([a-zA-Z_]+)/?$ jokes.php?c=$1 [QSA,NC,L]
RewriteRule ^jokes/?$ jokes.php [NC,L]