WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Change domains, one with dates and one without them (2 posts)

  1. polle001
    Member
    Posted 1 year ago #

    I am changing domains and I have a problem with redirection.

    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^old.com [NC]
    RewriteRule ^(.*)$ http://new.com/$1 [L,R=301]
    RewriteCond %{HTTP_HOST} ^www.old.com [NC]
    RewriteRule ^(.*)$ http://new.com/$1 [L,R=301]

    That works fine, but the dates in the permalinks are causing a problem.
    old.com/2010/12/16/infinity-blade
    new.com/infinity-blade

    The new domain does not use date.

    Can anyone tell me how my htaccess rules should be ?

    Thanks.

  2. polle001
    Member
    Posted 1 year ago #

    For anyone looking into this, try:

    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://new.com/$4

    That worked for me.

Topic Closed

This topic has been closed to new replies.

About this Topic