Where does the 404 redirection happen?

Based on your comments, I think I get what you’re saying. However, you don’t want to redirect on a 404, since it defeats the object of the ‘Not Found’ header. However, you can filter the 404 template path and pass back your own; function __custom_404( $standard_404 ) { if ( something_is_true() ) return ‘/absolute/path/to/custom.php’; return … Read more

Some plugins adding full server path after url (with custom wp-content folder)

Given that the js location is determined as follows: $js_location = WPSEO_URL . ‘js/wp-seo-admin-global.js’ where: WPSEO_URL = WP_PLUGIN_URL . “https://wordpress.stackexchange.com/” . <WP_SEO_PLUGIN_PATH> . “https://wordpress.stackexchange.com/” I suspect the problem lies with the derivation of <WP_SEO_PLUGIN_PATH>. This value is determined by the code in the function plugins_url() found in wp-includes\link-template.php If you debug that function, it may … Read more

404 error on all pages but homepage

Assuming you are on Linux, you need to make some changes in apache2.conf file stored in /etc/apache2 directory. Open the file with root permissions, you will find the code given below in the file. <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> Here just change the AllowOverride None to AllowOverride All, save … Read more

How to remove CPT comment feed from head?

Following command hides comments feed for posts (WP 4.4+ required!), but custom pages still have comments feed displayed, even if comments are disabled for such page: add_filter( ‘feed_links_show_comments_feed’, ‘__return_false’ ); To resolve this, I had to add this addidtional code too: function remove_comments_rss( $for_comments ) { return; } add_filter(‘post_comments_feed_link’,’remove_comments_rss’);

404 error after publishing a post

I just ran into something similar to this. It had to do with refreshing permalinks. If you go to Settings -> Permalink and just click save see if it fixes your problem. It did for me. In the end I added the following to my functions.php file which updated the permalinks for me. I was … Read more

Non “WordPress” pages/code getting 404 error

The problem your having is because of the way the WordPress rewrite system works. The WordPress .htaccess sends all requests (that dont actually exist except index.php) through the index.php file in the WordPress root directory. If any request is made for a file named index.php it will also get sent through the root WordPress index.php. … Read more

WP-admin giving 404

Since you rename the original plugin folder and create a blank plugin then it works. If in case log file is not immediately reflecting the error or it is not obvious for identifying the error. Moving the disabled plugin one by one to the new empty plugin folder is another way to find out which … Read more

WordPress monthly archive links result in 404

It looks like you need to add your news custom post type to the query for archive pages (I had the same problem). Codex: custom post types to query Add this code to your functions // Show posts of ‘post’, and ‘news’ post types on archive page add_action( ‘pre_get_posts’, ‘add_my_post_types_to_query’ ); function add_my_post_types_to_query( $query ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)