• Resolved PoliteShrimp

    (@terminator_5505)


    I’m migrating from blogger to WordPress everything was fine except when I was trying to add a 301 to redirect all old blogger pages like /p/about.html to /about
    I’ve changed my .htaccess file to look like that

    Redirect 301 /2013/12/old-post.html /2014/02/new-post.html
    RedirectMatch 301 /p(.*)\.html$ //$1
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    the problem is that my homepage is redirecting to the directory /age1 I don’t know why but every thing in other pages and posts return fine without any problems.

    removing line 2 in .htaccess solve the problem so I guess that line is the cause

    RedirectMatch 301 /p(.*)\.html$ //$1

    all I want is to add a single post to post 301 redirect and another redirect for pages but it seems that the page redirect code is causing a problem with wordpress

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did you figure out the problem?

    Thread Starter PoliteShrimp

    (@terminator_5505)

    yes you have to use that code instead

    RedirectMatch 301 /p/(.*)\.html$ //$1

    as you see the old code will redirect example.com/page1 to example.com/age1 which will cause a 404 error

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding RedirectMatch to .htaccess cause a homepage 404 error’ is closed to new replies.