初学者 URL 重写 htaccess [英] Beginner Url Rewrite htaccess

查看:11
本文介绍了初学者 URL 重写 htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想重写以下所有请求:

I would simply like to rewrite all requests from:

http://example.com/products/product.cfm?id=product-name

http://example.com/products/product-name

其次,

http://example.com/category.cfm?id=some-category&sub=sub-category

http://example.com/some-category/sub-category

这是我尝试过的:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^products/$1 ^products/product.cfm?id=$1 [NC] 

我确定这毫无意义,因为我真的不知道自己在做什么.我希望有人能告诉我我哪里出错了,这样我就可以以身作则.

I'm sure that makes no sense, as I really have no idea what I am doing. I was hoping someone could show me where I'm going wrong so I could follow by example.

谢谢!乔治

推荐答案

http://www. addedbytes.com/for-beginners/url-rewriting-for-beginners/

我不喜欢纯粹的链接"答案,但上面的链接对我非常有帮助:]

I don't like pure "link" answers, but the link above is extremely helpful to me :]

这篇关于初学者 URL 重写 htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆