Disabling .htaccess and using mod_rewrite within Apache config?

Is this possible to set for all sites/folders?
So no scanning and parsing of htaccess anymore.

And will behave just like Nginx.

I hope we can have a global config for this, to enable or disable.

Negate the default override rules with,

<Directory /home/virtual/siteXX/fst/var/www>
AllowOverride none
</Directory>

in /etc/httpd/conf/siteXX/custom.raw (use a .raw file), then run htrebuild to update the configuration. You can apply RewriteEngine on + rules within different directories as needed.

1 Like

So this cannot be forced by some config to be disabled for all site and for all folder location/just root public location?
So I don’t need to manually configure each site.

You could entirely by setting PREDIRECTIVES in /etc/sysconfig/httpd, specifically Define OVERRIDE_POLICY 'none', then running htrebuild.


# Set directives prior to httpd.conf parsing. Separate from OPTIONS
# to keep scope usage simple. To remove override restrictions:
# PREDIRECTIVES=("Define OVERRIDE_POLICY 'Options all'")
#
#PREDIRECTIVES=()
1 Like