.htaccess rewrite problem

software development

#1

I want to hide the .php extensions, so I made an .htaccess file with 630 permissions. Here it is:

SetEnv TZ America/Chicago
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ /$1.php [L,QSA]
Options -Indexes

My site is www.busybeepc.com

Why are the extensions showing?


#2

Wrong permissions on .htaccess. Try 644.


#3

Thanks, I double checked and it was set for 644 (not 630).

Any other ideas? I thought about putting each page in it’s own dir, but that would be a task I don’t want to just “try” without knowing if it will work. Any ideas?


#4

Seems to work to me:

http://www.busybeepc.com/About-Us
http://www.busybeepc.com/Knowledge-Base

Rewrite rules won’t modify the HTML your site generates, it just controls how the web server interprets URLs that you request. You’ll have to edit that yourself to remove the extensions.


#5

I’ll be damned… It sure does work!
Sorry, I’m a newbie.

So, if I point the target to “http://www.busybeepc.com/About-Us” instead of “http://www.busybeepc.com/About-Us.php” everything will work?