Question
I cant get rid of file extensions. What am I doing wrong?
So I have a .htaccess file and what I had put in it is not working.
This is what I put:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.*) $1.php [L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule (.*) $1.html [L]
Im trying to get rid of file extensions. Ive tried similar variations of that and it hasnt worked. Am I doing something wrong?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Solved:
Went to Apache Config file and set AllowOverride to All.
Ubuntu 18.04 Commands:
1:
2:
Then searched “AllowOverride”
3:
The last directory was where my index and .htaccess was so then I changed it from “none” to “all”
4: