开发者

Why can't I make my URLs rewrite in my htaccess file?

I've been开发者_开发百科 messing with this for the last hour... visiting about 20 different Google tuts and I can't seem make my site rewrite the url in any way. I've even just tried changing .php to .html and I'm not having any luck.

Here's one of my many fails:

RewriteEngine on
RewriteRule viewItem(.*)\.htm$ /viewItem.php?id=$1

For this above one, I'm just trying to change my viewItem.php page to viewItem.html

My ultimate goal is to change hxxp://mydomain.com/viewItem.php?id=900 (as one example of an id) to hxxp://mydomain.com/details/

I'm then going to append the title on the end. I can do the append in php but being a newb to .htaccess, I'm apparently missing something glaringly obvious.

Any ideas?

Thanks much.


Did you miss the 'l' of 'html'?

RewriteRule viewItem(.*)\.html?$ /viewItem.php?id=$1
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜