开发者

PHP mod rewrite .htaccess file godaddy.com question

I'm new to PHP and i was trying to lea开发者_开发问答rn mod rewrite to rewrite my URLs i use godaddy as my hosting company and they say to add the desired code to the body of your .htaccess file how do I mod rewrite my URLs and add it to my .htaccess file?

Can some one give me an example of how to do this as well as point me to a good tutorial and or book on how to mod rewrite my URLs?


http://articles.sitepoint.com/article/guide-url-rewriting

A note, though, goDaddy normally requires RewriteBase /

Quick 'n dirty

RewriteEngine On
RewriteBase /
RewriteRule ^/?about/?$ about.php [L,NC,QSA] # domain.com/about is sent to the server as domain.com/about.php
RewriteRule ^/products/([0-9]+)$ /products.php?id=$1 [L,NC,QSA]  # domain.com/products/23 is sent to the server as domain.com/products.php?id=23 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜