My site doesn’t redirect from HTTP to HTTPS

Your rewrite conditions, line 4 to 6 in your code, apply when https is active, so you are redirecting from https to https. Consquently you should change the conditions to check, if https is not active, ergo !on and !^443$ and !https. Additionally I’m not sure about the rule RewriteRule .* – [E=WPR_SSL:-https], probably something … Read more

Implementing a URL Shortener

Step 1: Create a new template file in your themes folder named: shorturl.php <?php /* Template Name: Short URLS Template Post Type: post, page */ while ( have_posts() ) : the_post(); $content=get_the_content(); header(‘Location: ‘.str_replace(“&amp;”,”&”,$content)); exit(); endwhile; Step 2: Create a new php file in your wp-content/plugins/ folder and name it: public-url-shortener.php <?php /* Plugin Name: … Read more

Strange behavior: random HTTP error 500 fixed by visiting Permalinks settings page (htaccess issue with language code)

Looks like it might be your WPML. See here: https://wpml.org/forums/topic/wpml-add-rewritebase-en-in-htaccess/ For posterity, the summary of this page is as follows: Problem: Some wrong settings caused an issue with “Use directory for default language”. A 500 error was showing. Solution: The client reports here that pressing the ‘Reset Settings’ button in WPML -> Languages probably solved … Read more

why is $_REQUESt[‘redirect_to’] empty?

The redirect_to variable works fine, even as a GET variable, however wp-login.php also uses wp_safe_redirect() for doing the actual redirection, which means that the URL must be on the same website. You can’t redirect to anywhere in the web, just to the same site as the login is located on. This is to prevent some … Read more

How to make my site use HTTPS for images or how to insert images as relative paths?

Main Issue As long as you are accessing the WordPress dashboard via HTTPS, new media items should be inserted into content using HTTPS in the associated media item URL. There is a bit more detail around that feature in this WordPress ticket: wp_get_attachment_url returns https when it should not. That ticket describes how wp_get_attachment_url returns … Read more

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