Changed permalink structure. Need help with redirecting old posts

I just changed the urls structure of my site and want old urls to be forward to the new without the use of redirection plugin.

Old structure: /%category%/%year%/%day%/%postname%/

New: /%postname%/

Can anyone you tell me the regix code for the redirect than I can insert in the .htaccess file? Thanks.

P.S. I tried yoast code regenerator and and it redirected the old urls to the new urls without the end trailing slash and then redirected again with the trailing slash. So, it generated 2 redirect chains instead of one.

I am not able to figure out the .htaccess code needed and the Yoast permalink generator code RedirectMatch 301 ^/([^/]+)/([0-9]{4})/([0-9]{2})/([^/]+)/$ https://www.website.com/$ 4 seems to cause redirect chain issue.

I would like to know how to correct this code RedirectMatch 301 ^/([^/]+)/([0-9]{4})/([0-9]{2})/([^/]+)/$ https://www.website.com/$ 4 so I can insert in my htaccess file. Thanks.

Has WP 5.7.2 possibly changed the email process, specifically, does anyone know where to find a list of PHPMAILER_EXCEPTION_CODES?

Been using a Form plugin for several years (forms haven’t changed for some time) and up until recently these forms have been fully functional … specifically … they are supposed to send both a submission email and a confirmation email after each form is submitted … for some unknown reason, the confirmation emails have stopped working

Wondering if one of, or combination of, 4 recent system updates may be involved;

  • WP 5.7.2
  • Centos 7.9
  • PHP 7.4
  • VFB Pro 3.4.4

So far I have;

  • regressed PHP to 7.2 (no change)
  • did a file comparison of the Plugin Update which indicates all changes appear to be unrelated to email
  • added some "log to file" debug statements to wp/wp-includes/pluggable.php function wp_mail() which indicate the plugin’s confirmation Email Call is throwing an Exception Error at line 535 $ mail_error_data[‘phpmailer_exception_code’] = 1

Any thoughts as to what does this exception code might mean?

The confirmation email does have; To, Subject, From, and Body/Headers

The Plugin’s Submission Email works properly

Could the content of an email possibly be throwing this process?

function getcode() doesn’t reveal any meaning for this exception code

Frustratingly hard to fix something without knowing what is actually causing the issue

Are there any other methods of debugging these kinds of issues without brute force debug statements?

Why do servers cache Web pages even though they know the Web page will be changed in the future?

For performance, some Web pages get cached. This is because the server can then speed up page load time:

Without a cached copy  +--SERVER--+                                                   +--CLIENT--+ | [file] --> load file from disk --> read file --> sends over --> loaded  | +----------+                                                   +----------+  With a cached copy +--SERVER--+                                             +--CLIENT--+ | [file] --> read file from cache --> sends over network --> loaded | +----------+                                             +----------+ 

This speeds up the operation.

However, when a file changes, the cache does not change. Even though the cache can speed up load time by a lot, the file is still old. The Web site has to regenerate the cache again.

So why do Web servers cache pages even though the file will have to change in the future?

Additional css urls changed from S3 links to live site links when downloaded the site for local development

So, I have a website with the Hueman theme. It’s all working properly on the live domain name but I needed to make some changes so I downloaded the whole website (files and database) on my local computer to make the changes and publish them on the live site.

What happened is extremely intriguing, at least to me. The header has a large background image done through css from Appearance > Customize > Advanced Options > Additional CSS and that image on the live site is an Amazon S3 link (all my media files go there) but when I set up the site locally the link in the "Additional CSS" changed to point to WordPress’ uploads directory on the live site and obviously that’s a 404 error.

The plugin which handles my S3 upload is "WP Offload Media Lite" and I have the "Amazon Web Services" plugin as well.

Here is my live site additional css:

/* You can add your own CSS here.  Click the help icon above to learn more.  Use this field to test small chunks of CSS code. For important CSS customizations, it is recommended to modify the style.css file of a child theme. http//codex.wordpress.org/Child_Themes */  /*@import url('https://fonts.googleapis.com/css?family=Kalam&display=swap'); */ html {     max-width: 100%;     overflow-x: hidden; }  #header {     background: url(https://imagecurve.s3.eu-central-1.amazonaws.com/wp-content/uploads/2020/12/21134758/Book-on-a-pebble-beach-propped-open-with-a-stone-hero-1920x650-1.jpg) center 0px no-repeat; }  nav#nav-header {     background: #33363b !important;     opacity: 0.9; }  #nav-header.nav-container {     box-shadow: none;     -webkit-box-shadow: none; }  #nav-header li a {     font-weight: bold; }  #header .pad {     max-width: 480px;     margin: 80px auto;     background: rgb(68, 68, 68);     opacity: 0.8;     padding: 30px 30px 20px;     padding-top: 28px;     padding-bottom: 30px;     text-align: center; }  #header .site-title, #header .site-description {     float: none; }  #header .site-description {     font-size: 17px;     color: rgb(255, 255, 255);     font-weight: 500;     text-align: center;     line-height: 40px;     padding: 0;     font-style: normal;     margin-left: 0; }  /* Subscribe form */ .widgetGuts .success {     background: #01c01e; }  .widgetGuts .subscribeButton {     background: #3b8dbd;     color: #fff;     padding: 8px 14px;     font-weight: 600;     display: inline-block;     border: none;     cursor: pointer;     -webkit-border-radius: 3px;     border-radius: 26px; }  #frm-subscriptionFrontsimplesubscribe-2 dl dt:first-child {     margin-bottom: 5px; }  #simplesubscribe-2 > h3 {     font-size: 20px; }  .post-meta .post-date {     display: none; }  /* Contact forms */ .wpcf7-form span.wpcf7-not-valid-tip {     position: static;     display: inline-block;     width: 100%;     margin-top: 8px; }  .wpcf7-form input[type=text], .wpcf7-form input[type=email] {     width: 100%; }  .wpcf7-submit {     border-radius: 26px !important; }  .nf-form-cont .submit-wrap input {     background: #3b8dbd;     color: #fff;     padding: 8px 14px;     font-weight: 600;     display: inline-block;     border: none;     cursor: pointer;     -webkit-border-radius: 3px;     border-radius: 3px; }  article.post-26078 > .post-inner, article.post-28116 > .entry {     max-width: 800px; }  #frm-subscriptionFrontsimplesubscribe-2 #frm-email {     width: 100%;     padding: 6px 8px;     box-sizing: border-box;     border-radius: 3px;     border: 1px solid #c7c7c7; }  #header-widgets {     float: none; }  #header-widgets p {     margin-bottom: 0; }  .ap-form-field .wp-switch-editor {     height: 25px; }  .social-links li:nth-child(3), .social-links li:nth-child(5) {     display: none; }  #header .site-description {     font-size: 22px !important; }  #explore-legends {       background: #dff3d5;     border: 2px solid #82b965;     padding: 65px 0 25px 0;     text-align: center;     margin-bottom: 20px;     border-radius: 18px; }  #explore-legends h3 {     color: #8a8989;     margin-bottom: 0;     font-family: 'Kalam', cursive; }  #explore-legends a {         background: #82b965;     display: inline-block;     padding: 7px 12px;     text-align: center;     color: white;     clear: right;     margin: 12px 0 35px 0;     border-radius: 13px;     width: 100%;     max-width: 165px;     box-sizing: border-box;     font-weight: bold; }  #explore-legends i {     font-style: italic;     color: #5d5d5d; }  @media(max-width: 1200px) {     #header-widgets {         margin-top: 5px;         display: block !important;     } }  @media(max-width: 1280px) {     #header {         background: url(https://imagecurve.s3.eu-central-1.amazonaws.com/wp-content/uploads/2020/12/21134754/Book-on-a-pebble-beach-propped-open-with-a-stone-hero-1280x500-1.jpg) center 0px no-repeat;     } }  @media(max-width: 1024px) {     #header {         background: url(https://imagecurve.s3.eu-central-1.amazonaws.com/wp-content/uploads/2021/01/06051411/Book-on-a-pebble-beach-propped-open-with-a-stone-hero-1024x420-2.jpg) center 0px no-repeat;     } }  @media (max-width: 785px) and (min-width: 720px) {     #nav-header li:nth-last-child(2) {         display: none;     } }  @media(min-width: 720px) {     #nav-header li:last-child {         float: right;     }      #nav-header li:nth-last-child(2) {         float: right;     } }  @media (max-width: 720px) {     #header .container .group.pad {         max-width: 252px;     }      #header .site-title {         padding: 0;     } }  @media (max-width: 580px) {     .wp-pagenavi span.extend {         display: block;     } }  @media (max-width: 480px) {     #header .container .group.pad {         margin: 50px auto;     }      #header {         background: url(https://imagecurve.s3.eu-central-1.amazonaws.com/wp-content/uploads/2021/01/06051527/Book-on-a-pebble-beach-propped-open-with-a-stone-hero-480x520-2.jpg) center center no-repeat;     } } 

Here is my local additional css:

/* You can add your own CSS here.  Click the help icon above to learn more.  Use this field to test small chunks of CSS code. For important CSS customizations, it is recommended to modify the style.css file of a child theme. http//codex.wordpress.org/Child_Themes */  /*@import url('https://fonts.googleapis.com/css?family=Kalam&display=swap'); */ html {     max-width: 100%;     overflow-x: hidden; }  #header {     background: url(https://www.imagecurve.com/wp-content/uploads/2020/12/21134758/Book-on-a-pebble-beach-propped-open-with-a-stone-hero-1920x650-1.jpg) center 0px no-repeat; }  nav#nav-header {     background: #33363b !important;     opacity: 0.9; }  #nav-header.nav-container {     box-shadow: none;     -webkit-box-shadow: none; }  #nav-header li a {     font-weight: bold; }  #header .pad {     max-width: 480px;     margin: 80px auto;     background: rgb(68, 68, 68);     opacity: 0.8;     padding: 30px 30px 20px;     padding-top: 28px;     padding-bottom: 30px;     text-align: center; }  #header .site-title, #header .site-description {     float: none; }  #header .site-description {     font-size: 17px;     color: rgb(255, 255, 255);     font-weight: 500;     text-align: center;     line-height: 40px;     padding: 0;     font-style: normal;     margin-left: 0; }  /* Subscribe form */ .widgetGuts .success {     background: #01c01e; }  .widgetGuts .subscribeButton {     background: #3b8dbd;     color: #fff;     padding: 8px 14px;     font-weight: 600;     display: inline-block;     border: none;     cursor: pointer;     -webkit-border-radius: 3px;     border-radius: 26px; }  #frm-subscriptionFrontsimplesubscribe-2 dl dt:first-child {     margin-bottom: 5px; }  #simplesubscribe-2 > h3 {     font-size: 20px; }  .post-meta .post-date {     display: none; }  /* Contact forms */ .wpcf7-form span.wpcf7-not-valid-tip {     position: static;     display: inline-block;     width: 100%;     margin-top: 8px; }  .wpcf7-form input[type=text], .wpcf7-form input[type=email] {     width: 100%; }  .wpcf7-submit {     border-radius: 26px !important; }  .nf-form-cont .submit-wrap input {     background: #3b8dbd;     color: #fff;     padding: 8px 14px;     font-weight: 600;     display: inline-block;     border: none;     cursor: pointer;     -webkit-border-radius: 3px;     border-radius: 3px; }  article.post-26078 > .post-inner, article.post-28116 > .entry {     max-width: 800px; }  #frm-subscriptionFrontsimplesubscribe-2 #frm-email {     width: 100%;     padding: 6px 8px;     box-sizing: border-box;     border-radius: 3px;     border: 1px solid #c7c7c7; }  #header-widgets {     float: none; }  #header-widgets p {     margin-bottom: 0; }  .ap-form-field .wp-switch-editor {     height: 25px; }  .social-links li:nth-child(3), .social-links li:nth-child(5) {     display: none; }  #header .site-description {     font-size: 22px !important; }  #explore-legends {       background: #dff3d5;     border: 2px solid #82b965;     padding: 65px 0 25px 0;     text-align: center;     margin-bottom: 20px;     border-radius: 18px; }  #explore-legends h3 {     color: #8a8989;     margin-bottom: 0;     font-family: 'Kalam', cursive; }  #explore-legends a {         background: #82b965;     display: inline-block;     padding: 7px 12px;     text-align: center;     color: white;     clear: right;     margin: 12px 0 35px 0;     border-radius: 13px;     width: 100%;     max-width: 165px;     box-sizing: border-box;     font-weight: bold; }  #explore-legends i {     font-style: italic;     color: #5d5d5d; }  @media(max-width: 1200px) {     #header-widgets {         margin-top: 5px;         display: block !important;     } }  @media(max-width: 1280px) {     #header {         background: url(https://www.imagecurve.com/wp-content/uploads/2020/12/Book-on-a-pebble-beach-propped-open-with-a-stone-hero-1280x500-1.jpg) center 0px no-repeat;     } }  @media(max-width: 1024px) {     #header {         background: url(https://www.imagecurve.com/wp-content/uploads/2021/01/Book-on-a-pebble-beach-propped-open-with-a-stone-hero-1024x420-2.jpg) center 0px no-repeat;     } }  @media (max-width: 785px) and (min-width: 720px) {     #nav-header li:nth-last-child(2) {         display: none;     } }  @media(min-width: 720px) {     #nav-header li:last-child {         float: right;     }      #nav-header li:nth-last-child(2) {         float: right;     } }  @media (max-width: 720px) {     #header .container .group.pad {         max-width: 252px;     }      #header .site-title {         padding: 0;     } }  @media (max-width: 580px) {     .wp-pagenavi span.extend {         display: block;     } }  @media (max-width: 480px) {     #header .container .group.pad {         margin: 50px auto;     }      #header {         background: url(https://www.imagecurve.com/wp-content/uploads/2021/01/Book-on-a-pebble-beach-propped-open-with-a-stone-hero-480x520-2.jpg) center center no-repeat;     } } 

The live site is here.

I tried googling but nothing sensible was found. I am confused, how could this happen?

Orientation changed event in Unity3D?

I’d like to listen to orientation change events, so for example my UI layout or the components themselves can be changed.

All I’ve found is that I should check the value of Screen.orientation every frame, and check if it has changed since previous frame.

But this isn’t really efficient, and I wonder why doesn’t Unity provide an event for this.

This asset seems to have what I need. Anyone knows how is it implemented?

As a last resort I could make a singleton behaviour which starts a coroutine which checks every X seconds whether it has changed, and if it has, I fire an event. But this still seems like a suboptimal solution.

What happens to a Devil when its alignment is forcibly changed?

According to PHB 122, in the section entitled Alignment in the Multiverse, for most creatures, “alignment is a moral choice.” Myth says good-aligned gods created the races that are free to choose to be evil (they have free will), while evil-aligned gods created the races that are very inclined towards evil, since they were born to serve the evil god in the first place.

However, there are some types of creatures — like devils — which embody an alignment in its essence:

Alignment in the Multiverse, PHB 122

A devil does not choose to be lawful evil, and it doesn’t tend toward lawful evil, but rather it is lawful evil in its essence. If it somehow ceased to be lawful evil, it would cease to be a devil.

My first thought was to not take this reading literally. The text could have meant that a neutral evil devil “isn’t really a devil,” but really, it’s still a devil. It’s a bit like imagining a guitarist who loses both hands. The loss of some part of a person’s essence makes them not the same person anymore.

However, keeping my attention on it, I’m finding this text more and more difficult to interpret. If a devil “is lawful evil in its essence” then what does it mean when “it would cease to be a devil”? What happens to a devil when its alignment is forcibly changed?

There are ways to forcibly change someone’s alignment, and a devil can be subject to some of them.

Behavior of Solve with $Assumptions changed in 12.2

Something changed with Solve between versions 12.1 and 12.2.

12.1:

Solve[n == n E^(r (1 - n)), n] (* Solve::ifun -- Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. *) (* {{n -> 0}, {n -> 1}} *)  $  Assumptions = {n >= 0}; Solve[n == n E^(r (1 - n)), n] (* Solve::ifun -- Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. *) (* {{n -> 0}, {n -> 1}} *) 

12.2:

Solve[n == n E^(r (1 - n)), n] (* Solve::ifun -- Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. *) (* {{n -> 0}, {n -> 1}} *)  $  Assumptions = {n >= 0}; Solve[n == n E^(r (1 - n)), n] 

enter image description here

Is this an improvement or a bug? It seems hard for the condition ConditionalExpression[1, Re[r] == 0 || Re[r] > 0 || Re[r] < 0] not to hold, but maybe I’m overlooking something.

Two work-arounds:

$  Assumptions = {n >= 0, r \[Element] Reals}; Solve[n == n E^(r (1 - n)), n]  Solve[n == n E^(r (1 - n)), n, Reals] 

both give {{n -> 0}, {n -> 1}} (no Solve::ifun either).

Another example, not fixable by including Reals:

$  Assumptions = {n1 >= 0, n2 >= 0}; Solve[0 == n1 (1 - n1 - 0.5 n2), n1] 

enter image description here

How to allow cantrips to be changed

The wizard in my game has requested the ability to change out his cantrips similarly to his higher level spells. His justification is that every other wizard spell is memorizable, so having fixed spells seems antithetical. I kind of agree with him.

I know that there is no mechanism for changing cantrips, but I’m trying to come up with a fair means of doing so.

The two extremes, as I see it, are:

  1. Cantrips can be swapped out just like preparing any other spell.
  2. Retrain a the cantrip, taking 250 days of Downtime, as if learning a new skill.

I’m interested in having a good middle ground option, patterned on other rules, if possible.


Here’s the house rules I have tentatively decided on. Critiques welcomed.

Cantrip House Rules

For all following rules, when using a cantrip that you don’t currently “know”, for classes that use a spell book, the cantrip must be in the spell book. Cantrips count as 1st level spells for purposes of price and scribing.

  • When you gain a level, you may swap one cantrip for another that you have available.

  • As a Downtime Activity, a cantrip can be swapped for another that you have available after 10 days of practice and the expenditure of 20gp.

  • Cantrips can be prepared and cast as 1st level spells. If the cantrip effects improve with level, the spell slot used to cast it must be 2 levels higher per step of improvement.

  • Cantrips can be cast as rituals. The cantrip improves with level as normal.

As with any house rule, I reserve the right to change it if it breaks.


Be warned! My DMing style is quite liberal. If you use this, wizards, druids, & clerics in your group may become unbalanced.