Mod_rewrite 规则 - 删除文件夹名称
我应该更改 URL 以获得 seo 排名。客户向我发送了新网址列表(30 项)。我是 mod_rewrite 新手,但今天我开始阅读手册
客户端
-> 服务器端
site.com/our-solutions/business.php
-> site.com/content/solution/bc.php
site.com/our-solutions/internal.php
-> site.com/content/solution/ia.php
site.com/our-solutions/assess-risk.php
-> site.com/content/why/assess.php
site.com/our-solutions/erm-risk.php
-> site.com/content/why/model.php
等等,
你能帮我写一下这个案例的规则吗?我已经预定义了 URL 列表,但您可以看到我必须从每个 URL 中删除文件夹内容并将页面名称更改为所需的
I should change URLs to gain ranking on seo. Customer sent me the list of new urls(30 items). Im noobie in mod_rewrite, but today I began to read manuals
Client side
-> server side
site.com/our-solutions/business.php
-> site.com/content/solution/bc.php
site.com/our-solutions/internal.php
-> site.com/content/solution/ia.php
site.com/our-solutions/assess-risk.php
-> site.com/content/why/assess.php
site.com/our-solutions/erm-risk.php
-> site.com/content/why/model.php
Etc.
could you helo me write the rules for this case? I have predefined list of urls but you can see I must to remove folder content from each URL and change the page name to desirable
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
开头应该是这样的:
我很抱歉,但你的问题听起来很像“我不是很好,所以有人可以帮我做这份工作吗?”。我的意思是,只要环顾四周,你就会得到很多答案,只要你亲自动手。
如果这还不够:
两个提示:
如果您不在托管环境中(= 如果它是您自己的服务器并且您可以修改虚拟主机,不仅仅是
.htaccess
文件),尝试使用RewriteLog
指令:它可以帮助你追踪此类问题:我最喜欢的检查正则表达式的工具:
http://www.quanetic.com/Regex (不要忘记选择ereg(POSIX) 而不是 preg(PCRE)!)
Here's what the beginning should look like:
I'm sorry but your question sound very like "I'm not very good, so can someone do the job for me?". I mean, just look around, you'll get a lot of answer, just get your hands dirty.
And if that's not enough:
Two hints:
If you're not in a hosted environment (= if it's your own server and you can modify the virtual hosts, not only the
.htaccess
files), try to use theRewriteLog
directive: it helps you to track down such problems:My favorite tool to check for regexp:
http://www.quanetic.com/Regex (don't forget to choose ereg(POSIX) instead of preg(PCRE)!)