越来越好的浏览器的URL重定向使用问题/重写规则 [英] problems getting nice browser url using redirect/rewriterule
问题描述
目前我使用的.htaccess重定向发送(好的)网址 /办公室/伦敦/不管以我的脚本(讨厌的URL)的 /db/db.pl?offices-london -whatever
Currently I use a .htaccess redirect to send a (nice) url /offices/london/whatever to my script (nasty url) /db/db.pl?offices-london-whatever
我想浏览器的URL是好的,与301重定向它不是,所以我试图与重写规则,但浏览器的URL仍是讨厌的。
i want the browser url to be nice, with the 301 redirect it isn't so i tried with the RewriteRule but the browser url is still the nasty one.
例如。重写规则办事处/伦敦/(.*)$ /db/db.pl?Offices-London-$1 [NC]
e.g. RewriteRule Offices/London/(.*)$ /db/db.pl?Offices-London-$1 [NC]
这一切进行导航,我得到我想要用这两种方法的页面,但我想漂亮的URL不是讨厌一个用于连接用户的浏览器和搜索引擎优化。 presently我只得到了讨厌的网址
it all navigates, i get the pages i want with either method, but i want the nice url not the nasty one for both the user browser and SEO. presently i only get the nasty url
任何线索,我在做什么错了?
any clues what i am doing wrong?
推荐答案
好了,感谢您的
问题不在于访问的剧本之一,这一切工作正常,这是获得浏览器的地址栏不显示丑路径/ URL,这正好与上面的例子中。
the problem is not one of 'accessing' the script, that all works fine, it is of getting the browser address bar to NOT display the ugly path/url, which happens with the example above.
对于搜索引擎优化,它并非如此,谷歌目前显示丑陋的URL。
as for the SEO, it is not the case, google is currently displaying the ugly url.
by reading through http://www.webmasterworld.com/forum92/6079.htm (and www.askapache.com/htaccess/mod_rewrite-basic-examples.html) i am slowly getting there, with two rewrites and a cond, but i have been lazy in my perl and the relative paths are screwed, so got to do some more on it.
尽管如此,现在我得做一些其他讨厌的客户的事情了一会儿。
for now though, i got to do some other pesky customer things for a while.
将在这里发布我的完整的解决方案很快!
will post my full solution here shortly!!!
这篇关于越来越好的浏览器的URL重定向使用问题/重写规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!