dousaoxiancy199896 2010-07-18 19:18
浏览 34
已采纳

使用.htaccess或任何其他方法调整动态生成的链接?

I have an e-commerce website (created with a ecommercetemplates shopping cart PHP template) and on the catalogue pages there are, at times, a few pages which are numbered at the bottom. The links to these pages are, for example, in the form:- /product.php?cat=27&pg=2 despite the main page having been mapped to:- /widgets using a rewrite rule in a .htaccess file.

For the sake of consistency and simplicity, I would like the pages to be as:- /widgets?pg=2. I asked in this forum how to do this and found the following solution:-

RewriteRule ^widgets$ products.php?cat=27 [QSA] 

The problem is that despite the above rewrite rule working as I wanted, the current links on the catalogue page still point to, for example:- /product.php?cat=27&pg=2. In order to go to /widgets?pg=2, I have to enter this in the browser.

So my question is: How do I change the current links on the catalogue page, which are dynamically generated? Are there any further rules which can be entered in .htaccess or is there any other solution to this problem? The following is the PHO code for the product page:- http://freetexthost.com/3ubiydspzm.

In the link above, if you do a search for 'writepagebar', I think this is where the 'next page', 'previous page', and the 'page numbers' are done.

  • 写回答

2条回答 默认 最新

查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法