Welcome to WebmasterWorld Guest from 54.226.60.235

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Filenames same as folder names

Server redirects to folder

     

Patrick Taylor

9:25 am on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a website with URLs like:

http://www.example.com/mything
http://www.example.com/mything/myotherthing

Until last December everything was fine, but since then, when the service provider upgraded cpanel, the server rewrites:

http://www.example.com/mything
to:
http://www.example.com/mything/ (with a trailing slash)

To allow extentionless URLs, my .htaccess file contains:

# Rewrite "string" everything to 'with-suffix'
RewriteRule ^([a-z0-9\-]+)$ /$1.php [L]
#
# Rewrite "string/string" everything to 'with-suffix'
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)$ /$1/$2.php [L]

The service provider has said that naming a folder (eg: mything) with the same name as a file is bad practice as the cpanel will tend to look at the folder as this takes a higher priority. Is this correct? Everything was fine for a couple of years, but not any more.

jdMorgan

1:08 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



If you're on Apache 2, see the DirectorySlash directive.

Jim

Patrick Taylor

6:39 pm on Mar 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Many thanks. At the top of the .htaccess file is now:

DirectorySlash Off

Back to normal.

Patrick

[edited by: Patrick_Taylor at 6:40 pm (utc) on Mar. 24, 2009]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month