0

On my current website I use parameters in querystrings to select the content shown to the user (e.g. www.domain.tld/index.php?site=linklist&page=2). I want to switch to wordpress and have all old links redirected to the new permalinks of wordpress.

When having site=linklist in the query string the user should be redirected to www.domain.tld/my-new-linklist . If the querystring contains site=about the user should be redirected to www.domain.tld/about-me ,...

How can I realize this using htaccess?

1
  • What have you tried so far, which part did you not get to work? This forum is about helping with specific problems. Not for having others do your homework. Read the excellent documentation, look at examples and have a try yourself first. Commented Oct 23, 2012 at 6:45

1 Answer 1

1

In the htaccess file in your document root, try adding these above any of your wordpress rules:

RewriteEngine On
RewriteCond %{QUERY_STRING} (^|.*)site=linklist&?($|.*)
RewriteRule ^/?index.php$ /my-new-linklist?%1%2 [L,R=301]

RewriteCond %{QUERY_STRING} (^|.*)site=about&?($|.*)
RewriteRule ^/?index.php$ /about-me?%1%2 [L,R=301]

etc.

Any other query string gets passed along, but the site=something is stripped out.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.