Hi, there! I got some issue when trying to setup .htaccess on my localhost apache2 server. Without .htaccess all work properly. But when I add it i have got an error:
.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
I started looking for mod_rewrite and it enabled.
sudo a2enmod rewrite && sudo service apache2 restart
“rewrite” already present
in my vhost.d AllowOverride All is present too.
My .htaccess:
RewriteEngine On
*#Fix Rewrite*
Options -Multivews
*#Mod Rewrite*
Options +FollowSymLinks
RewriteBase /login_with_session/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
*# used for php pages such as "yoursite.com/login.php" will become "yoursite.com/login/"*
RewriteRule ^([a-z_]+)\/?$ $1.php [NC]
I have read threads about this issue on this forum, StackOverflow and some proper blogs. But nothig from that can’t helped me. How I can fix this issue? I can work without it, but I’m studying and I wont to understand how this work. Thank’s is you just read this)