1

I have this site called precisely.me, and I have just bought a new hosting server for it.

In my .htaccess file, I want all my files within precisely.me/fpl/.php to also be accessible via precisely.me/fpl/. For eg -: precisely.me/fpl/epl-table.php should also be accessible via precisely.me/fpl/epl-table

Why is this not working?

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php

I am using GoDaddy.com's hosting, and should admit that I have little knowledge about the .htaccess file

4

1 回答 1

2

You may try this instead, in one .htaccess file in root directory.

Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI}  !\.php      [NC]
RewriteRule ^fpl/([^/]+)/? /fpl/$1.php  [L,NC]

Maps silently:

http://precisely.me/fpl/filename

To:

http://precisely.me/fpl/filename.php

Where filename is a dynamic string.

For permanent redirection, replace [L,NC] with [R=301,L,NC].

于 2013-03-30T09:32:31.787 回答