Permalink for specific page name

In your .htaccess you should be able to do something like what is shown by Chris Coyier on CSS Tricks. Link to example by Chris Coyier: https://css-tricks.com/snippets/htaccess/subdirectories-redirect-query-string/ Since you don’t have .php in your URL, WordPress has most likely already created RewriteEngine rules for you to not need .php. But the result should still work … Read more

disable WordPress 404 for one specific page/folder to receive actual php errors

You can add a RewriteRule to your .htaccess to instruct mod_rewrite to stop processing any URI that begins with Staff/ or resolves to Staff: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteRule ^/?Staff(/|$) – [END,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> In effect, this … Read more

How to have a custom URI path for specific page template

You need to add a rewrite rule to WordPress. There are several options to do it depending on your exact needs. Maybe the most general is using add_rewrite_tag() and add_rewrite_rule(): add_action( ‘init’, ‘cyb_rewrite_rules’ ); function cyb_rewrite_rules() { add_rewrite_tag( ‘%variable1%’, ‘([^&]+)’ ); add_rewrite_tag( ‘%variable2%’, ‘([^&]+)’ ); add_rewrite_rule( ^system/([^/]*)/([^/]*)/?’, ‘index.php?pagename=$matches[1]&variable1=$matches[2]&variable2=$matches[3]’, ‘top’ ); } Now, if the URL … Read more

How to fix .htaccess corrupted

Try reverting back to the default .htaccess file with the following code: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress If you’re using some other “flavor” of WP (e.g. multisite) view the htaccess docs on the … Read more

How to rewrite 404 to home page using htaccess?

There are a couple of ways to do this. If you’re using a custom theme or a child theme, add (or edit) a theme file called 404.php. The contents of that file should be: <?php header(“HTTP/1.1 301 Moved Permanently”); header(“Location: “.get_bloginfo(‘url’)); exit(); ?> You can add this code as a plugin, or put it in … Read more