Kieran Andrews
Kieran Andrews

Reputation: 5885

htaccess redirect url to page

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?

Upvotes: 3

Views: 2125

Answers (2)

J Bourne
J Bourne

Reputation: 1439

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

Upvotes: 0

Quentin
Quentin

Reputation: 944498

^advantage should be ^advantage$

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

Upvotes: 4

Related Questions