Friday , December 20 2024

Hosting, domain names

Hosting, domain names – articles, how-to-fix notes, fast solutions

301 redirect – remove slashes after domain name

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 »

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 »