Page name and directory name the same

If I have the following in a php website speed.php

How would I solve this?

right now if I access the website-tips.php file, it shows the directory and its interior pages

will this solve it?

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ $1.php

The site was a regular .html extension

so I changed the htaccess file to the following:

Options +FollowSymLinks

ErrorDocument 404  /404/

RewriteEngine on
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\\ /index\\.htm\\ HTTP/
RewriteRule ^index\\.htm$ [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\\ /index\\.php\\ HTTP/
RewriteRule ^index\\.htm$ [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\\s([^.]+)\\.php [NC]
RewriteRule ^ %1/ [R=301,L]

 remove trailing slash from URLs
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)/$ /$1 [R=301, L]

Basically I want to redirect all links out there from the .html extension to the new extension

I want to link within the site navigation as <href=“page-name”> NOT href=“page-name.php”>page name</a>

I want to remove all .php extensions in the address bar

I want to remove all trailing slashes unless it is a directory.

Am I going to be forced to change the directory name because it is he same as the page name?
I thought there was a workaround for this.



I’m not on staff any more but “bumping” is severely frowned upon. Please give people a chance to respond.

Your “same name” problem sounds like the typical problem generated by Options +MultiViews. That horrid directive tells the server to fetch a file (ANY file of the same name and regardless of extension) when in the path. Change that to Options -MultiViews (in your .htaccess file) and give it a test.



I thought staff became lighter. I appreciate your response which I did try before and no luck so far.

Perhaps show the code you tried, in case it had errors in it. The behavior you describe sounds pretty weird to me (meaning it’s not the default behavior I’d expect to see).