mod_rewrite的的.htaccess [英] Mod_Rewrite .Htaccess
问题描述
我有,我可以在我的网上搜索发现没有问题的。
I have a problem which I could not find during my online search.
我已经成功地做了一个通配符子域和子域主域名指向的文件夹。
I have successfully made a wildcard sub-domain and any sub domain to the main domain points to the folder.
我在找创建链接的URI参数,如
I am looking to create link URI to Parameters like
1 .domain.com /位置/ LOCATIONNAME 至 2- .domain.com // location.php? locname =
1- .domain.com/location/locationname to 2- .domain.com//location.php? locname=
然后
1 .domain.com /位置/ LOCATIONNAME /分类/类别名称/项目/了itemname 至 2- .domain.com//orderitem.php?locname=locationname&ordercategory=categoryname&orderitem=itemname
1- .domain.com/location/locationname/category/categoryname/item/itemname to 2- .domain.com//orderitem.php?locname=locationname&ordercategory=categoryname&orderitem=itemname
(2)是发生在后台和用户仍然可以看到(1)
(2) is happening in the backend and user still sees (1)
如何工作的?我必须让表中的MySQL,这我不知道它将如何绕过去。 二是爆炸的URL,并链接到像orderloc或ordermenu或订单项等特定的URL。
How will it work? Do I have to make table in MySQL, which I am not sure how it will go around. Second is to explode the URL and link to specific URL like orderloc or ordermenu or orderitem etc.
任何帮助将是更近了一步。
Any help will be a step closer.
感谢
推荐答案
这应该工作:
RewriteEngine On
RewriteRule ^location/(.*)/category/(.*)/item/(.*) //orderitem.php?locname=$1&ordercategory=$2&orderitem=$3\? [L]
RewriteRule ^location/(.*) //location.php?locname=\? [L]
它会显示 domain.com/location/locationname
给用户,但后端会看到`domain.com//location.php?locname=
It will show domain.com/location/locationname
to the user, but the backend will see `domain.com//location.php?locname=
和 domain.com/location/locationname/category/categoryname/item/itemname
给用户,但后端会看到<$c$c>domain.com//orderitem.php?locname=locationname&ordercategory=categoryname&orderitem=itemname$c$c>
and domain.com/location/locationname/category/categoryname/item/itemname
to the user, but the backend will see domain.com//orderitem.php?locname=locationname&ordercategory=categoryname&orderitem=itemname
这篇关于mod_rewrite的的.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!