WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Change domains, one with dates and one without them

[Resolved] Change domains, one with dates and one without them

  • 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.

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Change domains, one with dates and one without them’ is closed to new replies.
Skip to toolbar