Title: Redirect everything with permalink change
Last modified: January 27, 2020

---

# Redirect everything with permalink change

 *  Resolved [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/)
 * I am trying to redirect everything on the divorceecafe.com to divorceecafe.org.
   The former site uses /year/month/date/ in the URL but the new .org site does 
   not. If I want all URLs like:
 * [https://www.divorceecafe.com/2018/09/20/thankful-thursdays-the-unbroken/](https://www.divorceecafe.com/2018/09/20/thankful-thursdays-the-unbroken/)
 * to redirect to:
 * [https://www.divorceecafe.org/thankful-thursdays-the-unbroken/](https://www.divorceecafe.org/thankful-thursdays-the-unbroken/)
 * what parameters do I need to use and where do I enter them? Thanks for the guidance
   in advance.
 * Cemal
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fredirect-everything-with-permalink-change%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/page/2/?output_format=md)

 *  Thread Starter [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12367284)
 * Until I find a way of doing this using the Redirection plugin, I added a couple
   of lines to the .htaccess file to handle the job. If you get the link redirect
   you, it is because of the changes in the htaccess file. I would still like to
   learn how to du it using the plugin though, it is gentler and kinder solution
   I think.
 * Cemal
 *  [raymoncada1](https://wordpress.org/support/users/raymoncada1/)
 * (@raymoncada1)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12367331)
 * hey, just an idea, you might want to try regular expressions.
    This is your Current
   URL as regular expression. Make sure to use the ^ at the beginning. ^https:\/\/
   www\.divorceecafe\.com\/(\d{4}\/)(\d{2}\/)(\d{2}\/)(.*)
 * Check the regular expression test using this link: [https://regex101.com/r/vguaTC/1](https://regex101.com/r/vguaTC/1)
 * Redirect to
    [https://www.divorceecafe.org/$4](https://www.divorceecafe.org/$4)
   You are using $4 because is the 4th capture group.
 * This is the first 4 digits and the “/”
    $1 = (\d{4}\/)
 * The regular expresion below is repeated twice because it is the month and day.
   
   $2 and $3 = (\d{2}\/)
 * Lastly, it is the blog post
    $4 = (.*)
 * This is not tested but should work base on the instructions given on here [https://redirection.me/support/redirect-regular-expressions/](https://redirection.me/support/redirect-regular-expressions/)
    -  This reply was modified 6 years, 3 months ago by [raymoncada1](https://wordpress.org/support/users/raymoncada1/).
 *  Thread Starter [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12367356)
 * Thank you [@raymoncada1](https://wordpress.org/support/users/raymoncada1/), those
   are the expressions I used in the .htaccess file. However, I am not sure where
   to enter them in the plugin settings. Do I enter the entire line as the source
   URL and then the other as the destination or do the regular expressions go where
   parameters are entered? Any idea? I really would like to switch to using the 
   plugin rather than the .htaccess if I can.
 * Thanks,
 * Cemal
 *  [raymoncada1](https://wordpress.org/support/users/raymoncada1/)
 * (@raymoncada1)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12367370)
 * In the redirect setting click the advanced gear and to the far right select regex
   from the dropdown.
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12367660)
 * Enter the source URL, including regular expressions, in the source URL field 
   and the target in the target URL field. You will need to enable the regex option.
   You do not need to press the advanced gear icon.
 * [https://redirection.me/support/redirect-regular-expressions/](https://redirection.me/support/redirect-regular-expressions/)
 *  Thread Starter [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12368658)
 * I must be doing something incomplete. Although I copy and paste the lines from
   here to the fields, it does not work. I tried a couple of times and switched 
   back to the .htaccess file redirect. When I have more time later, I may try once
   more.
 * For clarity, will the long regex line work for the links that do not have dates
   or do I need to create a second rule for that? Like:
 * ^https:\/\/www\.divorceecafe\.com\/(.*)
 * [https://www.divorceecafe.org](https://www.divorceecafe.org)\$1
 * Thank you both very much,
 * Cemal
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12368670)
 * You only need the path part, not the domain. $1 does not need to be escaped
 *  Thread Starter [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12370487)
 * [@johnny5](https://wordpress.org/support/users/johnny5/), do I understand that
   I need to enter for the source:
 * ^/(\d{4}\/)(\d{2}\/)(\d{2}\/)(.*)
 * and for the destination:
 * [https://www.divorceecafe.org/$4](https://www.divorceecafe.org/$4)
 * Am I on the right track? If I do that, will the redirect handle URLs with no 
   date, like:
 * [http://www.divorceecafe.com/shop](http://www.divorceecafe.com/shop)
 * or do I need to create a second redirect like:
 * ^/\(.*)
 * for the source, and:
 * [https://www.divorceecafe.org/$1](https://www.divorceecafe.org/$1)
 * for the destination?
 * Thank you,
 * Cemal
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12370495)
 * The first pattern should work. You could remove the brackets, which capture data,
   for the date parts and just have the last part in brackets and then use `$1` 
   in the target. It doesn’t change anything but looks a bit simpler.
 * The pattern will only match date based URLs.
 * If you add the second pattern it will also match date URLs, which is not what
   you want. You would need to make sure it has a lower priority (i.e. larger number)
   then the date redirect so it doesn’t match first.
 *  Thread Starter [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12370515)
 * [@johnny5](https://wordpress.org/support/users/johnny5/), brackets? Do you mean
   the parentheses? All of them?
 * ^/\d4\/\d2\/\d2\/.*
    [https://www.divorceecafe.org/$1](https://www.divorceecafe.org/$1)
 * and
 * ^/\.*
    [https://www.divorceecafe.org/$1](https://www.divorceecafe.org/$1)
 * Sorry for the repeated questions, this is not something I use everyday. If I 
   write these incorrectly, could you please give me two pairs of lines, one with
   dates one without? I will copy and paste your lines into the fields.
 * Cemal
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12370527)
 * The round parentheses, yes. That captures information. You don’t need to capture
   the date information, so there is no need to surround it in round parentheses.
   You still need the curly brackets to indicate the number of digits.
 * ^/\d{4}/\d{2}/\d{2}/(.*) => /$1
 * It is also not necessary to escape the slash /.
 * I was only referring to the first pattern you put, not the second.
 * You can use [https://regex101.com/](https://regex101.com/) to test regular expressions
 *  Thread Starter [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12370538)
 * Thank you, [@johnny5](https://wordpress.org/support/users/johnny5/) I will try
   these. My eyes are not that good and I did not differentiate the curly brackets
   and the parentheses and used the latter on all. That might have been a part of
   the problem too. I will use the magnifier to make sure I am reading them correctly.
   So, my source line was altogether wrong.
 * I will experiment and let you know. I appreciate your help and expertise.
 * Cemal
 *  Thread Starter [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12370799)
 * No dice! When I test the redirect, I am getting
 * expected
    [https://www.divorceecafe.org/$1](https://www.divorceecafe.org/$1) 
   found: [https://www.divorceecafe.com/%5E/d%7B4%7D/d%7B2%7D/d%7B2%7D/(.*](https://www.divorceecafe.com/%5E/d%7B4%7D/d%7B2%7D/d%7B2%7D/(.*)
 * I think I will leave the htaccess file handling the redirect, it works for the
   URLs with or without dates in them. I know they are the equivalent but I must
   be doing something wrong in the plugin fields.
 * Thank you for your help in any case,
 * Cemal
    -  This reply was modified 6 years, 3 months ago by [acekin](https://wordpress.org/support/users/acekin/).
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12371532)
 * What are the exact settings you’ve used? Can you post a screenshot? It does not
   look like you enabled the regex option.
 *  Thread Starter [acekin](https://wordpress.org/support/users/acekin/)
 * (@acekin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/#post-12372868)
 * Thank you for following up, I will try later today and offer screen captures.
   I appreciate your willingness to help to make this work. Stay tuned…
 * Cemal

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/page/2/?output_format=md)

The topic ‘Redirect everything with permalink change’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 18 replies
 * 3 participants
 * Last reply from: [acekin](https://wordpress.org/support/users/acekin/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/redirect-everything-with-permalink-change/page/2/#post-12374114)
 * Status: resolved