How to prevent WordPress from redirecting single page to prefixed category archive with same name?

I have been trying to solve this problem for hours. I would like to have a page with a simple slug (/blog) and a category term with the same name (/category/blog) exist on my site together at the same time. But the problem I am running into is that my page (/blog) keeps redirecting to the category archive page (/category/blog).

I have tried the following:

  • adjusting my permalinks by clearly specifying my category base
  • using remove_action(‘template_redirect’, ‘redirect_canonical’); to suppress redirects
  • using add_filter( ‘template_redirect’, ‘blog_redirect_filter’, 10, 3 ); to try and target my blog category specifically

I am running out of ideas. How can I stop my site from redirecting an existing page to a category archive when they each have different slugs?

EDIT

I figured it out! Classic wait-until-you-post-publicly-before-figuring-it-out-yourself problem. It was a fun mix of Yoast, custom permalinks, and category bases all conflicting with each other.

My answer:

  • Make sure your category base is specified in Permalinks. Save them.
  • Remove any custom permalink slugs in the category terms.
  • Go to Yoast > Search Appearance > Taxonomies and scroll to the very bottom. Make sure Category URLs is set to Keep.
  • Clear any cache and/or flush_rewrite_rules.
  • Voila it’s fixed.

Go to Source
Author: Beth Mac

Difference between a buildpack and a dockerfile?

I understand a dockerfile to be a comprehensive set of instructions to completely build an application’s production (and development for that matter) environment from scratch (or at least from a bare linux distribution).

I understand a buildpack to be something responsible for retrieving and installing collections of dependencies and (similarly to docker) merging these to provide the app’s running environment. I also see from here:

Buildpacks were first conceived by Heroku in 2011. Since then, they have been adopted by Cloud Foundry and other PaaS such as Google App Engine, Gitlab, Knative, Deis, Dokku, and Drie.

But I wonder what are the differences then? E.g.

  • Are dockerfiles allowing more options than heroku buildpacks?
  • Do both have the same capabilities in terms of permissions and users?
  • Are they as versatile as eachother? (I know docker images can be run almost anywhere there is docker, is the same true of buildpacks?)
  • What other differences are there?

Go to Source
Author: stevec

How Can I Create a Friendly Slug for a Dynamic Page?

I built a dynamic page template that pulls biography information from a MySQL table.

The page works fine but the URL is ugly.

Officer-Biography/?ID=1

I have a set of canonical slugs that I want to use for each officer.

for example, Officer-Firstname-Lastname

I’ve tried both htacess and add_rewrite_rule and both give me 404.

example: add_rewrite_rule('Officer-Erich-Abberger', 'Officer-Biography/?ID=1', 'top');

What am I missing?

Go to Source
Author: jpollar