用户手册(seo + 自动生成)
我有一个网站,人们可以在线获取该手册。我有一个新版本的手册,其中所有内容都是使用 php 和 mysql 动态生成的。所以不再生成 html。
我现在有法语和英语的手册。我了解到,出于搜索引擎的目的,如果我有与 gogole 和 yahoo 等友好的 url 会很好...
现在这是我的问题:
我想显示这样的 url:
- /manual/ 将转到主手册用户选择语言的页面
- /manual/fr/ 这将显示所有可用章节的列表
- /manual/fr/1.0 这将显示第 1 章
我知道我需要在哪里使用类似的内容:
rewriterule /manual/(.*)/(.*)/(.*)/ index.php?lang=$1& ...
我可以使用1 规则?或者我需要多个?
非常感谢
i have a website that allows people to get the manual online. i have a new version of the manual where everything is generated dynamically using php and mysql. so no more html generated.
i have the manual in french and english now. i learn that for search engine purposes it will be good if i have url that are friendly with gogole and yahoo etc...
now here's my problem:
i want to show the url like this:
- /manual/ that will go to the main manual page where the user choose a lang
- /manual/fr/ this will display the list of all available chapters
- /manual/fr/1.0 this will display the chapter 1
i got the idea where i need to use something like :
rewriterule /manual/(.*)/(.*)/(.*)/ index.php?lang=$1& ...
can i do this using 1 rule? or i need multiples?
thanks so much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您必须做的:
第一个将加载用户选择语言的页面。在 PHP 中,您可以检查
$_GET['action']
以便加载“选择语言”页面。第二个想法与第一个相同,但章节列表不同。现在是第三个,您可以使用/manual/fr/1.0
或/manual/fr/1.0/chapter-title
。如果您添加标题,这将更适合 SEO。每个
RewriteRule
末尾的[]
是标志,在此处了解更多信息:http://httpd.apache.org/docs/2.3/rewrite/flags.htmlHere's what you have to do:
The first one will load the page where the user choose a lang. In your PHP you can check the
$_GET['action']
so you can load the "select the lang" page. The second same idea as the first one but for the chapter list. Now the third one, you can either use/manual/fr/1.0
or/manual/fr/1.0/chapter-title
. This will work better for SEO if you add the title.[]
at the end of eachRewriteRule
are the flag, learn more here: http://httpd.apache.org/docs/2.3/rewrite/flags.html