0

Basically i want to do this,

www.mydomain.com/index.html >> change to >> www.mydomain.com/

and checkout for example,

www.mydomain.com/cart.php >> change to >> www.mydomain.com/cart/

www.mydomain.com/checkout.php >> change to >> www.mydomain.com/checkout/

Would i do this in .htaccess? i have no idea.

Any help would be greatly appreciated.

4

2 回答 2

2

Use mod_rewrite to do this.

There are some examples on this page. :)

于 2011-03-02T15:05:44.577 回答
1
RewriteEngine On
RewriteRule   ^cart/([0-9]+)   cart.php?ID=$1 [L]

这将允许在附加为 id 的斜线之后使用任何数字 idwww.mydomain.com/cart/运行。cart.php

于 2011-03-02T15:07:17.660 回答