• I switched from my old CMS to WP and build a new website.
    But to preserve my google results I need to redirect some old website directories to the new wordpress directories. I did this in the .htaccess file, but it doesn’s work for all the redirect and I suspect the wordpress cms does some redirects itself.

    Some examples are:
    Redirect 301 /verspanings_producten_oplossingen http://www.excellentgereedschappen.nl/producten works fine and redirects to the right page.

    Redirect 301 /verspanings_voorbeelden/Gewefa http://www.excellentgereedschappen.nl/producten/opspangereedschap doesn’t work. The site is somehow redirected to http://www.excellentgereedschappen.nl/Gewefa/ and I have no clue why. I do have a supplier called Gewefa in the site with a logo called gewefa.jpg

    Redirect 301 /gereedschap/Opspangereedschappen/Weldonhouders http://www.excellentgereedschappen.nl/portfolio-view/weldon-gereedschaphouders doesn’t work. In this case I get a 404 not found. But in the url bar it shows a non existing wordpress page. Does wordpress decides to link to the non existing url http://www.excellentgereedschappen.nl/producten/opspangereedschap/Weldonhouders?

    Hope someone can help because I don’t have a clue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • In your .htaccess file, are the 301 redirect rules place above the WordPress Rewrite rules?

    Like below – you don’t need the http://www.excellentgereedschappen.nl – let DNS decide on www or not www also):

    
    # Put 301 Redirects just above WordPress Rewrite rules
    # try these rules in all lower case
    <IfModule mod_rewrite.c>
    Redirect 301 /verspanings_producten_oplossingen /producten
    Redirect 301 /verspanings_voorbeelden/Gewefa /producten/opspangereedschap
    Redirect 301 /gereedschap/Opspangereedschappen/Weldonhouders /portfolio-view/weldon-gereedschaphouders
    </IfModule>
    
    # BEGIN WordPress - Use yours here, defaults shown
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

    I think it would be much easier for you to use a plugin.

    I recommend https://en-au.wordpress.org/plugins/quick-pagepost-redirect-plugin/
    It’s never failed me 🙂

    I believe you have the correct approach – use .htaccess, it’s easy and adds minimal overhead (less plugins always = better)

    Thread Starter tobsie

    (@tobsie)

    I tried it. First with one line

    <IfModule mod_rewrite.c>
    Redirect 301 /verspanings_voorbeelden/Gewefa /producten/opspangereedschap
    </IfModule>

    Still redirects to http://www.excellentgereedschappen.nl/Gewefa/
    Of course I deleted initial redirection before adding the new lines.

    Any suggestions?

    Thread Starter tobsie

    (@tobsie)

    Ok it tested something.

    <IfModule mod_rewrite.c>
    Redirect 301 /gereedschap/Opspangereedschappen/Weldonhouders /portfolio-view/weldon-gereedschaphouders
    </IfModule>

    Still redirects to http://www.excellentgereedschappen.nl/producten/opspangereedschap/Weldonhouders for some strange reason.

    But when I redirect that url also it works:

    
    <IfModule mod_rewrite.c>
    Redirect 301 /gereedschap/Opspangereedschappen/Weldonhouders /portfolio-view/weldon-gereedschaphouders
    Redirect 301 /producten/opspangereedschap/Weldonhouders /portfolio-view/weldon-gereedschaphouders
    </IfModule>

    Very strange, but at least it works. Don’t know how google is handling this with 2 redirects.

    • This reply was modified 7 years, 4 months ago by tobsie.
    • This reply was modified 7 years, 4 months ago by tobsie.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Some redirects don’t work’ is closed to new replies.