• 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/(.*) https://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 https://www.website.com/search-friendly-url/ [R=301,L]

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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 https://example.com/two

    Thread Starter jcpenrose83

    (@jcpenrose83)

    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 https://www.oldwebsite.com/?q=node/2 https://www.newwebsite.com/search-engine-friendly-url/

    …shows this in the address bar:

    https://www.newwebsite.com/search-engine-friendly-url/?q=node/2

    …when I want:

    https://www.newwebsite.com/search-engine-friendly-url/

    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:https://mydomain.com to get a list of all your indexed URLs if the old Drupal site is still up.

    Thread Starter jcpenrose83

    (@jcpenrose83)

    Thanks @songdogtech that’s solved it for me!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘301 redirect of Drupal links to WordPress’ is closed to new replies.