DEV Community

Discussion on: Stopping .htaccess from handling API route

Collapse
 
denzyldick profile image
Denzyl Dick

Just a side note. The best way is not to use .htaccess. (Ignore me if you did know it already) :D

You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.
httpd.apache.org/docs/current/howt...

Collapse
 
coolgoose profile image
Alexandru Bucur

Considering the beginner question I would say using a .htaccess file is a good thing for now. Easier to test and experiment with.

Collapse
 
denzyldick profile image
Denzyl Dick • Edited

I also tell beginners they can use .htaccess but I also say that they (apache2 documentation) don't recommend it. It's something good to know even if you are a beginner :)

Thread Thread
 
ashokcodes profile image
Ashok Mohanakumar

I have to set it up on a shared hosting, so access to httpd.conf isn't available :) but thanks a lot!! Like I said, I am also trying to write a PHP MVC framework, so every bit of info is useful