Wp_redirect and sending variables

I’m afraid that you can’t do it this way. wp_redirect is a fancy way to send header Location and the second argument of this function is request status, and not custom variable. (404, 301, 302, and so on). You can send some variables as get parameters. So you can do something like this: if ( … Read more

WordPress localhost site redirect to live site

Try following If there are caching plugins installed like W3 total cache. Then purge cache first. Or may be disable them for time being Perform Search and Replace in the database for Old Site URL. You can Use this Plugin Reset Permalinks ( Dashboard >> Settings >> Permalinks ) Last but not the least. Clear … Read more

Redirect function inside a Shortcode

As @Rarst explains, shortcodes normally run too late for you to redirect from inside one. They usually run on the the_content hook which is well after content is sent to the browser. If you need to redirect based on the presence of a shortcode you need to check for that shortcode before any content leaves … Read more

Disable WordPress URL auto complete

I believe that is the redirect_canonical function hooked to template_redirect. You should be able to disable it with: remove_filter(‘template_redirect’, ‘redirect_canonical’); But you should really think about whether you want to do that as it is fairly complicated and performs some important SEO functions: Redirects incoming links to the proper URL based on the site url. … Read more

How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?

.htaccess skip WordPress 404 error handling for static files. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(robots\.txt|sitemap\.xml(\.gz)?) RewriteCond %{REQUEST_FILENAME} \.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC] RewriteRule .* – [L] </IfModule> Note: These rules were generated by the W3 Total Cache plugin* Nginx skip WordPress 404 handling for static files. if (-f $request_filename) { break; … Read more