I am trying to create a page with the same name as a directory that it is supposed link to, e.g.
What happens is that when I name my directory of blog articles blog and then name php webpage blog as well. Then I try to open the PHP blog webpage it throws an error (it gets me to the index page).
I originally had different names for the directory and webpage but I saw on a couple other sites that they solved this issue, but I don't know how. It currently works if I write a link like href="/blog.php"
instead of href="/blog"
but then the URL has the .php suffix, which I'd like to avoid.
This is my current Apache (.htaccess
) configuration:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]