Site icon PrestaShop | General Knowledge

PrestaShop What is htaccess file

In PrestaShop, the A .htaccess file is a configuration file used by the Apache web server. It controls how your website behaves without changing the main server configuration.

Common uses in PrestaShop:

Typical PrestaShop .htaccess location:

/public_html/.htaccess

or in your PrestaShop root folder.

Example:

# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Enable friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

In PrestaShop, the .htaccess file is usually generated automatically when you:

Path in admin:
Shop Parameters → Traffic & SEO

Important:

 

Exit mobile version