开发者

htaccess redirect url to page

开发者 https://www.devze.com 2023-02-21 03:36 出处:网络
I want to redirect a particular page using a 301 but my htaccess is also redirecting pages that contain the same start.

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 "som开发者_运维技巧e advantage" page

How do I fix this?


^advantage should be ^advantage$

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


This site is an expert on using mod_rewrite. Have a look at it. He is got lot of resources, if you are dealing with lot of rewrite rules. However whatever David said should work for the above question

0

精彩评论

暂无评论...
验证码 换一张
取 消