how to allow access to the . htaccess file

Asked

Viewed 406 times

0

My ". htaccess" is like this:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?/$1 [L]

RewriteCond %{HTTP_HOST} !^$

RewriteCond %{HTTP_HOST} !^www\. [NC]

RewriteCond %{HTTPS}s ^on(s)|

RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

it is in the main directory, if I delete this file the site works on localhost, but without formatting and functionalities, with the .htaccess message appears:

Internal Server Error

The server encountered an internal or wrong error and could not complete its solicitation.

Contact the server administrator in admin @localhost to inform them of the time this error occurred, and the actions you executed immediately prior to this error.

More information about this error may be available in the error log server.

someone knows how to solve?

  • What was in the server log regarding the error?

1 answer

0

Make sure apache mod_rewrite is enabled, you can enable it via terminal on linux:

a2enmod rewrite

or (in windows) via apache httpd.conf file that contains the modules, just uncomment the line with the module:

#LoadModulo rewrite_modulo modulos/mod_rewrite.so

Don’t forget to restart apache service then for the changes to take effect.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.