I have these urls:
index.php?area=guilds
index.php?area=guilds&page=create
index.php?area=guilds&page=view&name=The+Unit
Could I have only 1 rewrite rule for this somehow?
/guilds
/guilds/create
/guilds/view/The+Unit
I have these urls:
index.php?area=guilds
index.php?area=guilds&page=create
index.php?area=guilds&page=view&name=The+Unit
Could I have only 1 rewrite rule for this somehow?
/guilds
/guilds/create
/guilds/view/The+Unit
Try these rules:
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^[^/]+$ index.php?area=$0 [L]
RewriteRule ^([^/]+)/([^/]+)$ index.php?area=$1&page=$2 [L]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ index.php?area=$1&page=$2&name=$3 [L]
The first rule is to avoid that URLs are rewritten that already can be mapped to an existing file. The other rules reflect your three cases.
This one should work :
RewriteRule /(.+)(?:/(.+))?(?:/(.+))? index.php?area=$1&page=$2&name=$3