Permalinks suddenly stopped working on WordPress site, defaulting to /?page_id=XXX slugs. I need help restoring this
Permalinks suddenly stopped working on WordPress site, defaulting to /?page_id=XXX slugs. I need help restoring this
Permalinks suddenly stopped working on WordPress site, defaulting to /?page_id=XXX slugs. I need help restoring this
To clarify my comments (since comments don’t lend themselves to code blocks), you should only be using the .htaccess rules that apply to your particular WordPress installation. I’m assuming in this answer that you’re using WordPress greater than 3.5 (the current release as I write this is 6.7), and your question shows Subdomain Multisite. Thus, … Read more
404 with google ads query params
Non-existent URLs/slugs redirect to default Posts page
I didn’t install the multisite in the same root folder as my WC installation. I resolved it by doing so.
One of the ways to do this is by using mod_rewrite. Open your .htaccess file and add this code before the # BEGIN WordPress line: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^aritcles/(.*)$ /$1 [R=301,NC,L] RewriteRule ^news/(.*)$ /$1 [R=301,NC,L] RewriteRule ^reviews/(.*)$ /$1 [R=301,NC,L] </IfModule>
Redirect a 404 to search for the term but keep the 404 status code before the redirect
Yes this this doesn’t work when you have custom permalinks enabled. See the red warning box on the page you linked: WARNING: If you are using custom permalink, the trick below does not work, see this: http://core.trac.wordpress.org/ticket/7592. The trac ticket was closed as invalid so doesn’t look like this will change.
After some time banging my head against the wall, I found the solution. I used https://underscores.me/ as a starter for my theme. One function sets the main query, where one can add custom post types as well. So if anybody encounters the same problem, be aware of the hook “pre_get_posts”. function gp_add_cpt_post_names_to_main_query( $query ) { … Read more
Yes, it’s definitely possible to have multiple 404 pages for different purposes on a WordPress site, although it requires a bit of custom coding. You can achieve this by detecting the source of the 404 error and then redirecting to a specific 404 template based on the condition. Here’s a general approach to implement this: … Read more