help with REGEX - Mod_Rewrite "domain.com/directory/file.php" into "domain.com/file"?

I'm looking to rename the url "domain.com/directory/file.php" into "domain.com/file".

(remove directory name and extension)

I'm making my site dynamic with url like these: "domain.com/index.php?something=...." but for some pages I need the requested method above.

please show me the code to do that using mod_rewrite in .htaccess

I've tried something similar to "RewriteRule ^/$ /directory/ [L]" but it produces an "internal error".

2 Answers

Relevance
Still have questions? Get your answers by asking now.