• I’m migrating from a site with static html-files to WP. Most old urls already have user friendly urls (www.mysite.com/general/). I want htaccess to redirect my old urls to new pages and posts in WP, for instance, /general/ to /somedir/. The code I used:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    rewriteRule ^/general/$ /somedir/ [L,R=301]
    </IfModule>

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    This doesn’t work: nothing happens. Then I tried:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    Redirect 301 ^/general/$ /somedir/ [L]
    </IfModule>

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    This doesn’t work, either: this causes an internal server error. How can I redirect my old urls to my WP pages?

The topic ‘Internal server error on redirect’ is closed to new replies.