开发者

advance url rewriting [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improv开发者_Python百科e this question

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


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


RewriteCond %{QUERY_STRING} key=(.*)
RewriteRule /down.php /?k=%1 [R]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜