tags:

views:

36

answers:

2

how can i change

http://www.mydomain.com/down.php?key=1223

to

http://www.mydomain.com/?k=1223

i have google it but not found any ans...please help me...

i am using apache server with unix

A: 
RewriteCond %{QUERY_STRING} key=(.*)
RewriteRule /down.php /?k=%1 [R]
Ignacio Vazquez-Abrams
+1  A: 

You should use mod_rewrite. Add to your .htaccess file those lines:

RewriteEngine On 
RewriteBase /
RewriteRule ^\s+\.php\?key=(\d+) \?k=$1

Read about mod_rewrite and RewriteRules here: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteRule

milosz