user3160546
user3160546

Reputation: 13

Duplicate pages 301 redirects changing destination url

I have some dupilcate pages in my Joomla site.

Examples

/80-games

/80-games?start=12

/80-games?start=20

I did a 301 redirect in my .htcaccess for the first one which works fine.

My redirect for /80-games

    Redirect 301 /80-games http://www.teach-this.com/esl-games

But for /80-games?start=12

The url changes to http://www.teach-this.com/esl-games?start=12

What should my redirect be for /80-games?start=12

Somehow the question mark is causing my destination url to change.

Thanks

Paul

Upvotes: 1

Views: 88

Answers (1)

anubhava
anubhava

Reputation: 785561

You should use mod_rewrite as you cannot manipulate QUERY_STRING using mod_alias rules.

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On
RewriteRule ^80-games/?$ http://www.teach-this.com/esl-games? [R=301,L,NC]

Note ? at the end of target URI that is used to strip out any existing QUERY_STRING in the original URL.

Upvotes: 1

Related Questions