I just installed mod_rewrite and enabled .htaccess on my ubuntu apache server. But the url wont change when I edit the .htaccess to remove the .php file extension from files.
Right now my .htaccess file look like this:
Options -Indexes
ErrorDocument 400 /blabla.php
ErrorDocument 401 /blabla.php
ErrorDocument 403 /blabla.php
ErrorDocument 404 /blabla.php
ErrorDocument 500 /blabla.php
Not much, just making sure ppl cant view my filetree and added some custom error pages.
But if I enter a page on my site eg href="page.php" everything works, but if I remove the ".php" from the url bar and reload the page as "www.mysite.com/page" without the .php it still works. And I havent done anything in the .htaccess file, is this right?
if I now add the following lines to the .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
And then visit href="page.php" the url still shows up as "www.mysite.com/page.php" instead of "www.mysite.com/page"
Do I also need to change the href from href="page.php" to href="page" ? In order to make the .php extension disappear. - Because that works even if I dont edit the .htaccess file in the first place.
And I always make sure to restart apache when I edit the .htaccess file.
Thanks in advance, K