- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我的网站有这样的 url
http://www.mydomain.com/index.php?page=doctors&docid=99
使用SEO重写
RewriteRule ^doctors/([0-9]+)/(.*).html$ index.php?page=doctors&docid=$1 [L]
我明白了
www.mydomain.com/doctors/13/Dr.-John-Smith.html
但我想要一个像这样更友好的 url
www.mydomain.com/Dr.-John-Smith.html
我怎样才能获得这个 url。
最佳答案
重写查询字符串
如果您受雇从头开始重新创建现有网站,您可以使用 URL 重写将旧网站上 20 个最常用的 URL 重定向到新网站上的位置。这可能涉及将 prod.php?id=20 之类的内容重定向到 products/great-product/2342,它本身会重定向到实际的产品页面。
Apache 的 RewriteRule 只适用于 URL 中的路径,不适用于 id=20 这样的参数。要执行此类重写,您需要引用 Apache 环境变量 %{QUERY_STRING}
。这可以像这样完成:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^id=20$
RewriteRule ^prod.php$ ^products/great-product/2342$ [L,R=301]
RewriteRule ^products/(.*)/([0-9]+)$ ^productview.php?id=$1 [L]
在此示例中,第一个 RewriteRule 触发从旧网站 URL 到新网站 URL 的永久重定向。第二条规则将新 URL 重写为显示产品的实际 PHP 页面。
我希望这对您有所帮助,在这里可以找到更多关于重写的信息: http://coding.smashingmagazine.com/2011/11/02/introduction-to-url-rewriting/
它的布局非常简单。希望对您有所帮助,如果您有任何其他问题,请告诉我。谢谢。
关于apache - 重写 URL SEO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16202789/
我已经阅读了一些相关内容,但无法在任何地方找到明确的答案。所以,我想在这里问这个问题。 我正在构建一个旅游指南,其中包含大量分为标签的信息。每个选项卡都有自己的内容和关键字,我想在 SEO 中对其进行
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 7 年前。 Improve
显然,来自具有高网页排名的网站的链接有助于根据 SEO 对网站进行定位。我想知道如果链接“链接”到将您重定向到目标网站的网站,是否也是如此?或者爬虫会忽略重定向(通过 javascript 还是 ph
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8 年前关闭。 Improve this
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我们有一个网站 site.com,希望其他国家/地区的用户可以更快地访问该网站。想法是在每个大陆都有一个主机,并通过 GeoIP 重定向到该主机,例如:eu.site.com - 欧洲,us.site
我想将表格放在页面的页脚中,并使用主页面中的“联系”链接 作为 的 anchor . 从 SEO 的角度来看这是否合适,或者我应该放弃这个想法并坚持使用直接的联系页面?还是两者兼而有之? 最佳答案
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 7 年前。 Improve
我想为不同的版本设计不同的 html,但内容相同。我计划通过在选择哪个页面模板作为响应返回之前以编程方式确定请求设备来实现这一点。 我知道那里有响应式模板开发框架,但我们有意识地对走那条路不感兴趣,因
现在什么被认为是 url 结构的最佳实践? 出于某种原因,我认为在 url 末尾包含一个扩展名是一旦你进入层次结构的“最低”部分,例如 /category/sub-category/product.h
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 5 年前。
我在同一页面 上创建了两种不同的布局(使用 Bootstrap )。一种用于移动设备,一种用于桌面设备。网站有不同的页面,结构复杂。一些 block 应该只在桌面上可见,反之亦然。 这是一个示例页面:
如果我有这样一个网站: google.com/index.html?c=123123&p=shoes SEO 将其设置为: google.com/index.html?code=123123&foot
我们有一个网站,它会向后端系统发出昂贵的调用以显示产品可用性。我想消除这些对非实际客户的页面浏览量的调用。我的第一个想法是过滤用户代理,如果请求者是蜘蛛/搜索引擎爬虫,则显示“请求可用性”或类似的消息
我的 Joomla 网站有问题。菜单项的 SEO 可以有效地工作。因此,如果我键入“www.example.com/about”之类的内容,它将起作用并显示相应的文章页面。所以这表明 SEF URL
我看了很多关于 seo 的网络教程,但我从来没有发现一些较大的网站在搜索时如何以及为什么会出现这种情况......我不知道在 quora 和 yahoo 旁边问这个问题,但没有人在那里回答......
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求提供代码的问题必须表现出对所解决问题的最低限度理解。包括尝试过的解决方案、为什么它们不起作用,以及预
与其说是问题,倒不如说是问题。如果你能分辨出谷歌机器人和浏览你网站的其他用户之间的区别,然后你加载不同的内容取决于它是一个还是另一个,谷歌是否可以找到?毕竟,他们不会派人去目视检查。 最佳答案 你说的
我是一名优秀的程序员,十分优秀!