2010-06-16 76 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]