If you need to make ‘https://domain.com/////////////’ links like this ‘https://domain.com/’, you can copy the following solution to .htaccess. In this case, the redirect will be instant (not multistep). RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} !="" RewriteCond %{THE_REQUEST} ^[A-Z]+\s//+(.*)\sHTTP/[0-9.]+$ [OR] RewriteCond %{THE_REQUEST} ^[A-Z]+\s(.*/)/+\sHTTP/[0-9.]+$ RewriteRule .* https://%{HTTP_HOST}/%1 [R=301,L] RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ RewriteRule …
Read More »Hosting, domain names
301 redirect in .htaccess from uppercase to lowercase characters
In web development, managing URL consistency is crucial for SEO and user experience. One common task is redirecting URLs with uppercase characters to their lowercase counterparts. This article provides a working example for redirecting URLs like http://domain.com/sUcH_liNKs to their lowercase versions using .htaccess. While the solution is large and not …
Read More »How to find changed files in console
Relevant for Linux, macOS. This article lists commands that help you find files that have changed over a certain period. 1. Find all modified files in the current folder in order of freshness of changes. The most recent will be on top: find ./c -type f -printf '%TY-%Tm-%Td %TT %p\n' …
Read More »301 redirect with numbers removed from URL
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 »Error Not Acceptable An appropriate representation of the requested resource could not be found on this server.
After transferring the site to another host and trying to save changes in the admin panel, for example, such a code: <p class="block"> <svg xmlns="http://www.w3.org/2000/svg" width="700" height="72" viewBox="0 0 700 72"> <text x="0" y="70">Stroked text</text> </svg> </p> I get an error: Not Acceptable An appropriate representation of the requested resource …
Read More »301 redirect without slash to slash
In this article, I posted examples for redirecting from the pages without a slash to pages with a slash. Example 1: 301 redirect without slash to slash RewriteCond %{REQUEST_URI} !\? RewriteCond %{REQUEST_URI} !\& RewriteCond %{REQUEST_URI} !\= RewriteCond %{REQUEST_URI} !\. RewriteCond %{REQUEST_URI} !\/$ RewriteRule ^(.*[^\/])$ /$1/ [R=301,L] Example 2: 301 redirect …
Read More »301 redirect from slash to without slash
Examples of redirects from pages with a slash to without a slash: Example 1 – 301 redirect from slash to without slash RewriteCond %{REQUEST_URI} !\? RewriteCond %{REQUEST_URI} !\& RewriteCond %{REQUEST_URI} !\= RewriteCond %{REQUEST_URI} !\. RewriteCond %{REQUEST_URI} ![^\/]$ RewriteRule ^(.*)\/$ /$1 [R=301,L] If your site uses a CMS (for example, Opencart), …
Read More »Redirect 301 from https to http
This is one of the examples of the implementation of redirection from https to http. RewriteEngine on RewriteCond %{HTTP:HTTPS} =on [NC] RewriteRule ^(.*)$ http://domainname/$1 [R=301,L]
Read More »“Parse error functions.php on line 1064” when installing WordPress
The error that occurred when installing a fresh version of WordPress on a new hosting: Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /wp-includes/functions.php on line 1064 The solution turned out to be extremely simple: the PHP 5.4 version was activated on the hosting, when the …
Read More »How to create a full backup of a WordPress site
I will not get tired of repeating how important it is to make backups of sites. This article describes 3 options for creating a backup – via ssh, via ftp, via the hosting provider’s panel, using a plugin. Option 1: backup via ssh 1. Connect to the server (you can …
Read More »