Shortening URLS
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.
Use mod_rewrite to do this.
There are some examples on this page. :)
RewriteEngine On
RewriteRule ^cart/([0-9]+) cart.php?ID=$1 [L]
This will allow www.mydomain.com/cart/
to run cart.php
with any numerical id after the slash to the appended as an id.
精彩评论