0

After moving this mod_rewrite code from .htaccess in the directory to apache2.conf its no longer working

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^                   index.php [L,NS]

error

Bad Request

Your browser sent a request that this server could not understand.

clarkk
  • 2,035
  • 8
  • 24
  • 36

1 Answers1

2

You need to put them inside a Directory block.

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.

user9517
  • 115,471
  • 20
  • 215
  • 297