I have a case – for all product URLs, I need to remove numbers and dashes with a 301 redirect, for example: remove 1234- from /category/1234-product/. Instead of 1234- there can be any numbers. But at the same time, I don’t need to change the URL /0192-test/ in the root …
Read More »Correct transfer Drupal site from http to https
The certificate was purchased and activated, the site with https does not open correctly. The way to solve this problem: 1. In the file sites/default/settings.php find the line with $base_url. Under this line add: $conf['https'] = TRUE; $base_url = 'https://old.domain.com'; Replace the domain name with the actual one, and do …
Read More »Fatal error: Allowed memory size when executing a script or importing a dump into a database
The Fatal error: Allowed memory size error indicates that there is not enough time and limits on the server to complete the process that you started. Here is the actual block for inserting into .htaccess, with which the limits from php.ini will be increased, after that you can import a …
Read More »How to remove generator in Drupal 7
By default, the source code of Drupal sites contains the line <meta name=”generator” content=”Drupal 7 (http://drupal.org)” /> To remove it, you need to edit the file /sites/all/themes/mytheme/template.php (instead of mytheme, go to your site’s theme folder), find function shop_adaptive_html_head_alter and add before the closing character } this line: unset($head_elements['metatag_generator_0']); If …
Read More »Display: inline-block does not stretch to width, but sticks to the left In Safari
The problem is described in the title of this article. If elements that in normal browsers stretch across the width of the stage with active display: inline-block; in Safari ignore the width and stick together on the left, then for the parent to which this inline-block was assigned, try to …
Read More »If the link contains another domain/subdomain
The task is relevant if hosting subdomains refer to the root of the main site, or if several domains are registered as aliases to each other. If you need to write noindex/nofollow etc., you can simply write a condition in index/header section: <?php $host = $_SERVER['HTTP_HOST']; if($host == "old.domain.com" or …
Read More »Error installing plugins – sprintf(): Too few arguments in class-bulk-upgrader-skin.php
I got this error after installing a third-party free theme. Full text of the error: Warning: sprintf(): Too few arguments in /wp-admin/includes/class-bulk-upgrader-skin.php on line 152 Here is the solution – in the file /wp-admin/includes/class-bulk-upgrader-skin.php find and replace this code: if ( $this->result && ! is_wp_error( $this->result ) ) { if …
Read More »Fixed panel that can only be closed once
The solution was for the message “We use cookies to enhance your experience in our web site. By visiting it, you agree our Cookies Policy.” It is important that the panel does not reappear after closing/accepting the agreement. Here is the HTML, CSS, JS code to implement the panel on …
Read More »Popup image on click without href
A very elegant solution, with which the image will not be wrapped in <a href=””></a>, image will float on click to the center of the screen and will be able to close both on the top cross and on a click on a translucent background. Image code: <div class="image__wrapper"> <img …
Read More »How to change 302 to 301 redirect in Opencart
By default, OpenCart automatically enables 302 redirects. However, using 302 redirects is not ideal for SEO purposes because they indicate a temporary redirect. For better search engine optimization, it’s important to use 301 redirects, which signify a permanent move. This article provides a step-by-step guide on how to change 302 …
Read More »