Let's try it a different way.
redirect = browser address bar changes.
rewrite = browser address bar stays the same, but server secretly fetches content from some other place
Given the two forms
let us please assume that what you want to do is:
and browser's address bar says so. But the content of the page comes from
When I use this:
RewriteRule ^/somedirectory/(.*) /somefile.php?qstring=$1
I get: The requested URL /somedirectory/somevalue was not found on this server.
That means the rewrite is not taking place. Is this happening in htaccess? If so, you MUST omit the leading directory slash, or the rule will always fail. Keep the opening anchor.
Can we assume for the sake of discussion that other RewriteRules work? If nothing works, you may have forgotten some essential boilerplate like RewriteEngine On. (Theoretically also "Options +FollowSymLinks", but I think almost all hosts switch this on in the config file if they're going to allow mod_rewrite in htaccess at all. I've never had to say it myself.)
And as long as we're in assuming-for-the-sake-of-discussion mode, let's also assume that your desired target somefile.php actually exists and has been programmed to await a qstring input ;) Quick edit:
Is "somedirectory" always the same, so the target file doesn't have to do anything about that part?