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 »How to remove slash in Opencart category urls
Opencart version 2.3, the task was to make all URLs like /category/subcategory/product and remove links to http://domain-name/product (from the root). Duplicates for SEO are not cool, the task is simple. To combine URLs and bring them to the standard, it is enough to select Seo Pro in the System – …
Read More »How to insert your css file into a website
If you need to create a separate css file and use it for your website, copy this code and insert in the head section this one: <link rel="stylesheet" type="text/css" href="newfile.css">
Read More »Transition – smooth effects
A sharp change in the background when hovering over the block, or a sharp change in the color of the button text when hovering, without effects does not look cool. To make a smooth “fade”, you need to use one property for the main element, and for its :hover. Code …
Read More »Perfect robots.txt for WordPress
In this article I have posted 2 examples – simple and advanced. In each example there will be lines that you need to change, below there will be notes with specifics of what should be changed. 1st robots.txt, optimized for SEO User-agent: * Disallow: /cgi-bin Disallow: /? Disallow: /wp- Disallow: …
Read More »How to display a product attribute anywhere in Woocommerce
With this code, you can display a product attribute in the template, for example, “size”. global $product; echo $product->get_attribute('size'); Below I publish a method for displaying a property with an additional icon output, if this property is filled in: <?php $subheadingvalues = get_the_terms( $product->id, 'pa_time'); if ($subheadingvalues): ?> <div class="labeltime"><i …
Read More »How to hide the Details tab in the Woocommerce product card
The attributes of the product are displayed in the tab Details/Additional Information. If only a 1-2 of attributes are displayed on your site, then the tab will look ridiculous without content. There are two options: hide the tab using css styles, or delete it using the engine. Option 1: hide …
Read More »How to display product SKU in Woocommerce product card
As it often happens, we do not need product SKU where it is placed in the template. To display in the right place, use this code: <?php echo '' . $product->sku . ''; ?> When I published this code on a test project (in /woocommerce/single-product/short-description.php) as a result, the product …
Read More »How to display all attributes of a Woocommerce product
Often I need to display all the attributes of a product in another place in the template, not in a separate tab with characteristics. To solve this case, use the following code: <?php global $product; $product->list_attributes(); ?>
Read More »