1

Attempting to add some rewrite rules to the root .htaccess for my Magento 2 installation, but additions to that file are not reflecting. What I want to achieve is to create two rewrite rules. One for trailing slashes and one to rewrite requests to lowercase.

  • I have confirmed that rewrites are enabled.
  • The base secure and unsecure URLs end in a '/'.
  • After modifying the .htaccess files, I restart Apache 2 as well as clear the Magento cache files.
  • I have tried modifying both the root .htaccess and the /pub/.htaccess

Here are the rewrites I would like to add:

############################################
## Rewrite trailing slashes

RewriteCond %{REQUEST_URI} !(.*)/$
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpg|png|jpeg|css|js)$ [NC]
RewriteRule ^(.*)/$ /$1 [L,R]

############################################
## Rewrite uppercase to lowercase

RewriteMap  lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]

System is running Magento 2.1.9 with PHP 7 Apache 2.4 on Ubuntu 16.04

Ideas?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.