Support » Fixing WordPress » Need Help Redirecting Old urls using .htaccess and RewriteRule

Viewing 10 replies - 1 through 10 (of 10 total)
  • Try updating

    RewriteRule ^/blog/_archives/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+).html$

    to

    RewriteRule ^blog/_archives/([0-9]{4})/([0-9]{2})/([0-9]{2})/([0-9]{7}).html$

    Also, if you’re using a modern version of WordPress, its RewriteRules now look like this:

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

    Hi

    thanks for trying to help – still no joy. Here’s how things stand currently:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    # Redirect FeedBurner to your own Feed
    RewriteRule ^blog/_archives/^([0-9]{4})/^([0-9]{2})/^([0-9]{2})/^([0-9]{6,7}).html$ /$1/$2/$3/ [QSA,L]
    RewriteRule ^feedburner_929946/?$ /feed/ [R,L]
    RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # These Rules redirect all feed Traffic to FeedBurner
    RewriteCond %{QUERY_STRING} ^feed=(feed|rdf|rss|rss2|atom)$
    RewriteRule ^(.*)$ http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
    RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
    RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
    # These are the standard WordPress Rules
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    This is really starting to bug me – any ideas anyone?

    I’m still making no progress – can anyone help?

    Try looking at this thread and see if it helps. Good luck.

    http://wordpress.org/support/topic/69983

    Hi

    I found this thread and it solved all my problems in 2 mins. If anyone needs a CLEAR guide to .htaccess read this post.

    http://forums.digitalpoint.com/showthread.php?t=23044

    Hi

    I’m trying to use .htaccess to redirect old urls on my old blog to my new WP blog e.g. need to get http://www.example.com/blog/_archives/2005/10/13/1907475.html to redirect to http://www.example.com/2005/10/13/

    Can someone tell me what is wrong with my .htacesss file please.

    thanks

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    # redirect /blog urls to / urls
    RewriteCond %{REQUEST_URI} ^/blog [NC]
    RewriteRule ^blog/_archives/200([0-9])/([0-9]+)/([0-9]+)/.*.html$ /200$1/$2/$3/ [R=301,QSA,L]
    # redirect feed to feedburner
    RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]
    RewriteRule ^feed/?.* http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [L,R=302]
    </IfModule>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    SRC: Redirecting WordPress Feeds to Feedburner

    RewriteRule ^blog/_archives/200([0-9])/([0-9]+)/([0-9]+)/.*.html$ /200$1/$2/$3/ [R=301,QSA,L]

    Might want to add a leading / in front of “blog”. Like so:

    RewriteRule ^/blog/_archives/200([0-9])/([0-9]+)/([0-9]+)/.*.html$ /200$1/$2/$3/ [R=301,QSA,L]

    WPChina

    (@wordpresschina)

    Yikes, I’m still having problems.

    I just changed a blog over to wordpress. The old RSS feed was found at http://www.domain.com/news.rss and I want to change it to the wordpress feed at http://www.domain.com/feed/

    I tried doing this, but it did not work:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteRule ^feed$ news.rss [L]
    </IfModule>

    Any ideas what I’m doing wrong?

    Tks!

    The [L] means that no more rules will be processed if that one matches. So it matches
    RewriteRule . /index.php [L]
    and stops. Also note that WordPress may overwrite your rules.

    Put:
    RewriteEngine On
    RewriteRule ^feed$ /news.rss

    at the start of your htaccess file, before #BEGIN WordPress.

    I’m not quite sure if the rule is what you want. If you want to change requests for news.rss to point at the WordPress feed, it’s the wrong way round. Change it to:
    RewriteRule ^news.rss$ /feed/

    WPChina

    (@wordpresschina)

    thanks jrawle! I had this answered here:
    http://wordpress.org/support/topic/106507

    Because this thread was already resolved when I posted my support question, I figured it might be best to start a thread to ensure someone could assist. Many thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Need Help Redirecting Old urls using .htaccess and RewriteRule’ is closed to new replies.