WordPress: htaccess redirect (301) doesnt work

I have a task which drives me nuts: I have an old blog and want to create a 301 redirect to my new blog for several posts because I moved some of the content to the new domain.

Let’s say one of my old posts is to be find at example.com/this-is-my-post and visitors should be redirected to example.org/my-old-post-2817.

Read More

What I tried is this:

# BEGIN Redirect

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING}  ^$
RewriteRule ^this-is-my-post$ http://example.org/my-old-post-2817 [R=301]
</IfModule>

# END Redirect

The problem is that there is no redirect in FF (desktop), Chrome (Android) and standard internet browser (Android). In IE (desktop) I get an error stating that the page can’t be displayed. No reason is given.

I made sure not to have any unneccessary blank lines in the .htaccess and, to be on the safe side, deleted my browser’s histories, caches and so on.

A CCA of my provider dropped me a message that he re-saved the mod rewrite module and that I have to try it 15 minutes later again. With no success.

So, what did I wrong?

Regards,

Crunchy

Related posts

Leave a Reply

1 comment

  1. Change order of rules to keep R=301 rules before internal WP rules:

    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{QUERY_STRING}  ^$
    RewriteRule ^this-is-my-post/?$ http://example.org/my-old-post-2817 [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule . index.php [L]