-3

I am creating small data entry software using php with ajax code. But I didn't create .htaccess file. I have one doubt. must we create .htaccess file ? why we create .htaccess file. Please suggest.

Muhammad Hassaan
  • 7,296
  • 6
  • 30
  • 50

2 Answers2

0

A .htaccess file is not mandatory. It has many uses and if there is a specific need, you have to use a .htaccess file. If not, you can ignore it.

For example with .htaccess you can do redirections, you can do authentication with username and password, you can restrict specific directories and many more uses.

In your case, if your needs dont forward you to the use of .htaccess, just dont use one. Although most websites nowadays have at least 1 need that .htaccess covers.

Simos Fasouliotis
  • 1,383
  • 2
  • 16
  • 35
0

.htaccess is an Apache config file, it works in hierarchical mode, if you load it in a folder, it apply the configuration to all subfolders.

.htaccess is helpful to set timezone, redirect, customize error pages and enable or disable cache.

It is not mandatory however it is recommended its use.

Slaiv206
  • 309
  • 2
  • 14
  • Why is it recommended? I can think of many, many situations where you **don't** need an `.htaccess` file? Primarily I use them to handle rewrites or password protect folder etc. – Cyclonecode Apr 20 '17 at 09:02