I've got a couple of RewriteRules inshtaccess for Search engine optimization reasons. Sample...

RewriteEngine On 
RewriteRule ^signup$ /signup.php
RewriteRule ^account$ /account.php
RewriteRule ^logout$ /logout.php
RewriteRule ^login$ /login.php
RewriteRule ^recent-questions$ /recent.php
RewriteRule ^popular-questions$ /popular.php
...
...
 (more similar stuff)
...
...
RewriteRule ^(.*)/([-_~*a-zA-Z0-9]+)\|([0-9]+)(\/)?$ view.php?title=$1&id=$2&%{QUERY_STRING}
RewriteRule ^([-_~*a-zA-Z0-9]+)(\/)?$ categories.php?key=$1

The machine is within a sub-folder "request" around the server.

All of them work fine basically map the folder to http://ask.mydomain.com

But I'd rather not make use of a sub-domain since I am adding a current header &lifier footer handled by others that share resouces and consists of relative links using the primary www. website.

After I attempt to access the folder via http://www.mydomain.com/ask the RewriteRules with hyphens inside them lead to 404 errors - another ones still work.

I have already attempted getting away the hyphens as - and %2D. The previous made no difference. The second takes me to some completely incorrect page.

Solution -- It had not been the hyphens whatsoever.

It had been because MultiViews was enabled for www. domain names, although not for request. domain names

/register would map to /register.php with MultViews default behavior,

but

/recent-question does not map to recent.php

Underneath the request. subdomain the URL rewrites inshtaccess where being processed properly. But MultiViews was breaking it underneath the www. domain.

In my experience, you appear to become changing using the wrong groups:

RewriteRule ^(.*)/([-_~*a-zA-Z0-9]+)\|([0-9]+)(\/)?$ view.php?title=$2&id=$3&%{QUERY_STRING}

must do basically understand properly that the Web addresses possess the form mydomain.com/bla/title|id