Hello, i'm attempting to make just a little application that will assist multiple accounts, each with it's user, etc.

so essentially i acquired:

RewriteEngine on

RewriteBase /


RewriteRule ^$                        index.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d


RewriteRule (.*)/(.*)/(.*)$                       index.php?account=$1&task=$2&id=$3

this works acceptable for http://sd.domain.com/accountname/index/

although not for: http://sd.domain.com/accountname, is tossing a 404.

and so i think i have to only use the variables only if you will find present, in order to make something similar to:

http://sd.domain.com/accountname -- default index controller --

http://sd.domain.com/accountname/index

http://sd.domain.com/accountname/campaigns/

http://sd.domain.com/accountname/view_campaign/5 -- campaign id ought to be here --

Thanks ahead of time, hope anybody might help.

Do this.

RewriteRule ^([^/]+)/?([^/]*)/?([^/]*)$ index.php?account=$1&task=$2&id=$3