2010-06-16 77 views
0

我需要一个像URL重写使用的.htaccess

mydomain.com/myname/?action=post&data=10 

在这里,在一个单一的PHP页面(user.php),我需要所有mynamepost10如GET方法变量的URL。我怎样才能使用.htaccess

+0

复制http://stackoverflow.com/questions/122097/apache-mod-rewrite-primers – 3h4x 2010-06-16 11:36:26

回答

0

您可以添加以下为.htaccess

RewriteEngine On 
RewriteBase /myname/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?$1 [L]