【发布时间】:2012-08-21 05:52:26
【问题描述】:
我要做的是从旧项目模块中重写我的 URL 中的一些单词,以便它们看起来适用于当前项目。
我开始的网址是:
http://WEBSITE.com/stories/topic/view/pet_id/6/topic_id/41
我在 .htaccess 中拥有的是:
# Change Pet and Topic to Story and Chapter
RewriteCond stories/topic/view/pet_id/([A-Za-z0-9-]+)/topic_id/
RewriteRule stories/topic/view/pet_id/6/topic_id/.*$ stories/chapter/view/story_id/6/chapter_id/$1
没有为条件末尾的数字添加部分,因为我真的只需要改变到那个点的单词。也不确定这是否可以。
不确定我没有错,希望那里的 mod_rewrite 大师之一可以帮助我。谢谢!
【问题讨论】:
标签: apache mod-rewrite friendly-url seo