.htaccess用参数重写PHP文件?

I basically have a file like this:

user.php

It has different get Parameters:

user.php?method=GetUserData
user.php?method=SetUserData

I want to call it according to REST like this:

server.com/GetUserData
server.com/SetUserData

Is this possible?

A more accurate version of Pogrindis' solution would be to add the following to a .htaccess file:

RewriteRule ^([GS]etUserData)$ user.php?method=/$1 [NC]

This works if these are the only two methods you need to set — as the regex pattern matches only "GetUserData" and "SetUserData".

This prevents other base links (such as http://server.com/MyPage) from being converted as well.