Skip to main content

htaccess

Wordpress htaccess configuration

as you know that WordPress is one of the most famous CMS in the world but unforunatily it is not secure enough and we have to protect it somehow abd also we need to setup some cache configuration in the htaccess

First thing you need to do is to disable directory listing by adding this line to .htaccess

Options All -Indexes

 

the other thing you need to do is to setup the objects cache (image/css files/ js files)

this is one of the best code we can use 

 

 

Magento 2 static files are not working

How many times you tried to install Magento 2 and later you could not see the website working !!, How many times you tried to search for these sentences 

"Magento 2 css not working"

"Magento 2 js not working"

"Magento 2 404 page not found" because of the static files?

Now here is the solution, and easily it is the missed .htaccess (for apache)

by quick look at this path "{magento root}/pub/static", you will see that you missed the .htaccess file