WPML – 404 Error when I try to pass GET parameters in my “different languages in directories” installation

The problem your GET param is using the same name as the query var for your custom post type. $link = $link_aqui_se_sirve.’?’.$establecimientos_cpt_name.’=’.$tax->slug; With that URL, WordPress is expecting the value of the $establecimientos_cpt_name parameter to be a post slug. Instead you are giving it a taxonomy slug. This will give you a 404 unless you … Read more

Force 404 redirect to home?

A 404 should never be a redirect. A redirection status begins with 3, not with 4. You can either include the index.php (or home.php or front-page.php) in your 404.php or just remove the 404.php from your theme. Then WordPress will use the index.php.

When I remove get_header() from 404 page, my css doesnt work

Of course it doesn’t. When you remove get_header() you also remove the code that loads the CSS files, not to mention that you remove large blocks of necessary HTML markup. The template you’ve posted above is very, very broken. You’ve also left out get_footer() which will most likely leave your markup broken as well. Instead … Read more

URL Change – Check if Post Exists Before 404

function checkArtist() { $page = get_page_by_path($_SERVER[‘REQUEST_URI’].”https://wordpress.stackexchange.com/”,OBJECT,’artist’); if($page){ header(“HTTP/1.1 301 Moved Permanently”); header(“Location: /artist”.$_SERVER[‘REQUEST_URI’]); } } add_action( ‘wp’, ‘checkArtist’ ); I add a custom hook using wp which as the article says: This hook is one effective place to perform any high-level filtering or validation, following queries, but before WordPress does any routing, processing, or handling. … Read more

WordPress Site Page Exists but Error 404

WordPress stores on the options table two urls for the site: siteurl and home. They should be the first two entries in the options table. Make sure that after migrating those two options match with your new domain. Duplicator should have taken care of it but just check to make sure.