开发者

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

开发者 https://www.devze.com 2023-04-07 02:01 出处:网络
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 t

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

精彩评论

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