doukun8670 2011-03-31 06:21
浏览 115
已采纳

htaccess将url重定向到页面

I want to redirect a particular page using a 301 but my htaccess is also redirecting pages that contain the same start.

Example:

I want to redirect:

http://domain.com/advantage

To:

http://domain.com/index.php?page=some advantage

My current rule is

RewriteRule ^advantage "index.php?page=some advantage" [L,R=301]

This rule also redirects

http://domain.com/advantage-form.php

To the "some advantage" page

How do I fix this?

  • 写回答

2条回答 默认 最新

  • dongyouzhi7218 2011-03-31 06:23
    关注

    ^advantage should be ^advantage$

    i.e. Instead of "Start, then advantage" it should be "Start, then advantage, then End".

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?