Redirect to 404.php from single.php

Try something like this: header(“HTTP/1.0 404 Not Found”); $wp_query->set_404(); //This will inform WordPress you have a 404 – not absolutely necessary here, but for reference only. require ‘/path/to/404.php’; exit; Just do the error handling on the page itself instead of redirecting it to another template. This will maintain your 404 header and give you complete … Read more

Need rewrite for URL with specific string

You should solve this at the plugin level. While this rewrite rule … RewriteRule (.*)/?mysite.com/(.*) /$1/$2 [L,R=301] RewriteRule ^(.*)THUMB /$1 [L,R=301] … does what you are asking for, it is just cosmetic. Find the code that creates the wrong URL and fix that. Give the plugin author feedback; I’m sure s/he wants to know about … Read more

Google PageSpeed: Avoid landing page redirects?

One of the most wasteful redirects happens frequently and web developers are generally not aware of it. It occurs when a trailing slash (/) is missing from a URL that should otherwise have one. For example, going to http://astrology.yahoo.com/astrology results in a 301 response containing a redirect to http://astrology.yahoo.com/astrology/ (notice the added trailing slash). This … Read more

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