I'm not a mod_rewrite expert by any means, but this is an example of how I put together the .htaccess for the Image Flair site:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/(.*)\.png$ imageFlair.php?mode=$1&userid=$2 [L]
RewriteRule ^(.*)\.png$ imageFlair.php?userid=$1 [L]
</IfModule>
This basically maps:
MODE/USERID.png ->
imageFlair.php?mode=MODE&userid=USERID
and
USERID.png ->
imageFlair.php?userid=USERID
You should be able to adapt that to your needs, but you may have a couple of issues:
- If you want to use "names" rather than IDs on your URL you will need to alter the PHP to accept the names.
- You might have an issue with /Page and /ModuleType conflicting, if you wanted to also include more parameters in with Page, unless you can put together a regex that can determine which is which.
Going on the list of URLs you want, this should work, although I won't claim it's the best or only way to do it :-)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/(.*)/(.*)$ index.php?m=$1&categoryID=$2&productID=$3 [L]
RewriteRule ^(.*)/(.*)$ index.php?m=$1&categoryID=$2 [L]
RewriteRule ^(.*)$ index.php?Page=$1 [L]
</IfModule>
As suggested, you may want to replace the .* with [^/]+ but I had issues with non-matches when I did that, and had no time to troubleshoot, so YMMV :-)