【发布时间】:2013-04-05 23:07:49
【问题描述】:
我正在尝试通过使用 mod_rewrite 使我的 URL 对用户和 SEO 更友好,我确保我有 mod_rewrite 可用并启用,并且我已经编写了一个规则,但我没有得到任何工作,如下是我作为 http://hoursofdev.bitnamiapp.com/searchResults.html?fLat=41.7420294&fLong=-72.7398906&tm=&dt=&ct=&loc=&runBy=query&locType=gps&q=Starbucks 的 mod-rewrite 规则所拥有的(此 URL 由 javascript 函数创建)
变成
http://hoursofdev.bitnamiapp.com/Starbucks.html
.htaccess
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /searchResults.html?fLat=41.7420294&fLong=-72.7398906&tm=&dt=&ct=&loc=&runBy=query&locType=gps&q=$1 [L]
我还确保在我的 httpd.conf 文件中允许覆盖。
任何可以帮助我弄清楚为什么我没有看到任何重写规则过程的方向都会有很大的帮助。
谢谢。
【问题讨论】:
标签: javascript html apache mod-rewrite