i need to set up an apache RewriteRule in order to have this behavior:
example.com/foo => index.php?module=foo&action=&args=
example.com/foo/bar => index.php?module=foo&action=bar&args=
example.com/foo/bar/baz => index.php?module=foo&action=bar&args=baz
example.com/foo/bar/baz/foobaz => index.php?module=foo&action=bar&args=baz/foobaz
I wroted this regex:
RewriteRule ^(.[^/]*)(\/)?(.[^/]+)?(\/)?(.+)?$ index.php?module=$1&action=$3&args=$5 [L,QSA]
It works well, i only need to tell apache to ignore all urls that end with some specific estension (for example, .jpg, .png, .css, .js, .gif, etc..); Those should be treated as normal, e.g. example.com/css/style.css should show the CSS file (is it exists).
Any idea?