⊗dpPPBsST 3 of 27 menu

Two Types of Servers for PHP on Hosting

There are two popular types of server software for websites: Apache and Nginx. As a rule, on hosting, PHP works either in conjunction with Apache or in conjunction with Nginx.

For us, as PHP programmers, it doesn't matter which server is used. With one important exception. The thing is, that the htaccess file is a configuration file for the Apache server. This means that if your server is running Nginx, then your htaccess will not work.

Nginx has a mechanism similar to the htaccess file. This mechanism represents configuration files created for each site. Unfortunately, if you have virtual hosting, you won't be able to access these files.

Considering that all sufficiently complex sites use htaccess, we need exactly the Apache server. Fortunately, it is installed on almost all virtual hostings.

It is often the case that Apache is used in conjunction with Nginx. In this case, Nginx accepts requests to the site from the external world and passes them to the Apache server. And PHP already works in conjunction with Apache and, accordingly, htaccess also works.

We will study these servers in more depth in other, more advanced tutorials. And in the next lesson, we will simply check if the htaccess file works on your hosting.

Will htaccess work if you have Nginx?

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline