301 redirect of Drupal links to WordPress (5 posts)

  1. jcpenrose83
    Posted 3 years ago #

    Hi everyone,

    I'm having trouble getting 301 redirects to work as I'd like for pages from an old Drupal site into corresponding new pages on WordPress. Does anyone have any advice on this please?

    This code works...

    RewriteRule ^?q=node/(.*) http://www.website.com/?p=$1 [R=301,L]

    ...but I've hit a stumbling block because I need the URLs to be like this in the end...

    RewriteRule ^?q=node/2 http://www.website.com/search-friendly-url/ [R=301,L]


  2. Johnb81
    Posted 3 years ago #

    Hi jcpenrose83,

    do you have a lot of pages? Also, are you using the same domain? If there aren't many pages I would do the redirects one by one in a .htaccess file using the below code.

    Redirect permanent /one http://example.com/two

  3. jcpenrose83
    Posted 3 years ago #

    Hi Johnb81,

    There's about 25 pages so happy to do them manually, but doing 301's like that the query element of the Drupal URL is kept by WordPress so it looks messy using...

    Redirect permanent http://www.oldwebsite.com/?q=node/2 http://www.newwebsite.com/search-engine-friendly-url/

    ...shows this in the address bar:


    ...when I want:


  4. The remaining query string is a result of a problem with your 301 directive in .htaccess.

    Try WordPress › Redirection « WordPress Plugins. It allows all manner of redirects and 404 logging. Import a CSV of your old URLs or enter them by hand.

    Google search with the string site:http://mydomain.com to get a list of all your indexed URLs if the old Drupal site is still up.

  5. jcpenrose83
    Posted 3 years ago #

    Thanks @songdogtech that's solved it for me!

Topic Closed

This topic has been closed to new replies.

About this Topic