I've got a website that utilizes mod_rewrite for pretty web addresses. I've two primary web addresses:

example.com/id
example.com/generate/id

Which htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^generate/([a-z0-9_-]+)$ generate.php?id=$1 [L,NC]
RewriteRule ^([a-z0-9_-]+)$ contact.php?id=$1 [L,NC]

The very first url is working properly, however the second not. Apache shows a 404 error, I believe it's since it is searching for the folder "generate", that does not exist, also it aren't able to find the htaccess within the document root.

Thanks

Perhaps you have try

RewriteRule ^generate\/([a-z0-9_-]+)$ generate.php?id=$1 [L,NC]