【发布时间】:2013-09-06 23:45:16
【问题描述】:
我正在努力使我的网站对 SEO 更友好。我研究了这个和其他几个网站,但基本上没有一个解决方案有效。使用这个简单的代码可以很好地重写 URL:
RewriteRule ^testpage\.php$ destination.php [NC,L]
但是,当我尝试在动态页面上实现 RewriteRule 并在 URL 中传递变量时,什么也没有发生。这是我现在无法使用的代码:
RewriteRule ^([^/]*)\.html$ /prodinfo.php?prodid=$1 [NC,L]
我想要http://www.mysite.com/products/prodinfo.php?id=268 转换为http://www.mysite.com/268.html
我在 Apache 2.2 和 php.5.3 谢谢。
【问题讨论】:
-
什么不起作用?你看过 RewriteLog 的输出吗?
标签: apache mod-rewrite url-rewriting