Does WordPress only support HTTP 1.1?
Does WordPress only support HTTP 1.1?
Does WordPress only support HTTP 1.1?
An easy solution is to use .htaccess rules. #Redirect HTTP to HTTPS RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
The proper way to send a status (when WordPress is not available) is: http_response_code( 403 ); See the PHP Manual for its definition. But in Plugin files, this should never be the “default” code on top of a file header. See Worthwhile to restrict direct access of theme files? for a discussion. In WordPress, use … Read more
You can do this: add_filter( ‘http_request_host_is_external’, ‘__return_true’ ); However, note that this disables this security feature. If you know the host or url isn’t going to change and is always going to be that, you can be more secure by checking for that explicitly: add_filter( ‘http_request_host_is_external’, ‘allow_my_custom_host’, 10, 3 ); function allow_my_custom_host( $allow, $host, $url … Read more
Easy! You have a couple of options to do so. The easiest one, but less safe, is to create a brand new PHP file in the root folder of WordPress. Let’s say we will call it get_post.php and add WordPress functionality to it. Like so: <?php require_once(‘wp-load.php’); // add wordpress functionality $post = $_POST; if … Read more
This is mostly pure PHP, but it does have WordPress twist. PHP has number of superglobal variables, that contain information relevant to current request. Out of those: $_GET contains info from URL (HTTP GET request) $_POST info from form submission (HTTP POST request) $_COOKIES about cookies set and $_REQUEST is combination of the above (according … Read more
Solution 1: Enable mod_header on the server and added this rule to my appache2.conf file: <IfModule mod_headers.c> RequestHeader unset HTTPS </IfModule> Solution 2: Or you need to add the code to fonction.php file of your current theme: function https_chrome44fix() { $_SERVER[‘HTTPS’] = false; } add_action(‘init’, ‘https_chrome44fix’,0);
You can try these: 1. make sure the values changed in database If you can’t login to wp-admin > settings to confirm that, you can go to database, wp_options table and look for siteurl and home values 2. add code to wp-config.php Add these lines to wp-config.php define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); 3. Clear your cache Make sure … Read more
Well, at my situation… I downloaded the company website from production to localhost because I was needed to prepare a development environment for some developers. The production is using https:// and at localhost http://, and when I ran it the first time on localhost, it always redirected me to the https://. And, I have managed … Read more
Thanks to @chrisguitarguy’s answer, you can control the http headers sent by WordPress via the “send_headers” hook. Here is the function I added to my theme’s functions.php file, and that solved the issue with the Varnish server. function varnish_safe_http_headers() { header( ‘X-UA-Compatible: IE=edge,chrome=1’ ); session_cache_limiter(”); header(“Cache-Control: public, s-maxage=120”); if( !session_id() ) { session_start(); } } … Read more