Disallow the access to all files and folders with dot at the beginning

It is a good practice to disallow the access to all files and folders with dot at the beginning, except for .well-known folder (it is used for certificates verification and for security.txt file).

 

Apache .htaccess:

 

Nginx:

 

 

 

Scroll menu in PrestaShop 1.7 back-office

When you have many modules which adds buttons to the menu you are not able to see/click button from bottom of the menu because it’s not visible.

Very simple solution to allow scrolling the menu

Open file: /admin/themes/default/css/overrides.css and append this:

Open file: /admin/themes/default/js/admin-theme.js and append this:

 

 

 

[Qt] Easily print to console (i.e. for debugging)

How to print to console when using Qt?
Use QTextStream:

Error on file upload: UPLOAD_ERR_PARTIAL

When I was trying to send a file via the HTML form, I saw “error=3” in the $_FILE variable, what means:
UPLOAD_ERR_PARTIAL – The uploaded file was only partially uploaded.

The php_sapi_name() function returned me ‘apache2filter’.
I removed libapache2-mod-php5filter and installed libapache2-mod-php5.
Now php_sapi_name() returns ‘apache2handler’ and files uploading works good now 🙂

Quickly define the file lines limit and cut the first lines

Use this command if you want to keep only a certain number of the most recent lines in the file without using an additional file.

Replace:
* yourFileName – your filename
* 200 – the number of lines you want to keep

 

Create friendly URL based on product name in Prestashop using SQL query

Below you will find simple SQL queries which creates product friendly url from product’s name and saves them in the database SEO section.

You can run this i.e. in phpmyadmin or MySQL Workbench.

Example of action

From product name $ My super product 1 !!! it will create friendly url my-super-product-1

Queries

Continue reading Create friendly URL based on product name in Prestashop using SQL query