Don't add the rewrite rule to your .htaccess
file. WordPress manages that file for you, so try to use built-in features whenever you can.
WordPress actually has a somewhat advanced rewrite engine that ships standard - and it's pluggable just like the rest of the platform.
The trick, though, is working with it. You'll need to register your RegEx so WordPress knows what kinds of strings to match (i.e dynamic/location/(.*)/code/(.*)
=> /dynamic?$loc=$1&code=$2
). Then you'll need to set up the page and script on the back end to handle the submission.
For a similar example, look at the answer I received to parsing custom URLs with a custom post type over on WordPress Answers. Extending this, you'll need to set up code similar to the following (note: untested!!!):
<?php
add_action('init', 'add_my_rewrite');
function add_my_rewrite() {
global $wp_rewrite;
$wp_rewrite->add_rule('location/([^/]+)/code/([^/]+)','index.php?loc=$matches[1]&code=$matches[2]','top');
$wp_rewrite->flush_rules(false); // This should really be done in a plugin activation
}
This should add the rewrite structure to your .htaccess
file automatically.
Best Solution
I would've said htaccess but you say no result?
Are you sure you did it right?
or something like that.
Sorry if I'm teaching to suck eggs, but at least you can tick it off with someone else giving you the same thing you've tried :)
edit:
OK you've tried that. Now I'm guessing we're looking at this the wrong way?
RewriteRule ^user/?u=([.]+)$ User/$1
I'm not sure if wordpress will understand this though.