PDA

View Full Version : directory access without trailing slash doesn't work after 3.3.9


ts77
04-29-2008, 01:35 AM
Hi folks,

I just found that directory access like
http://domain.com/directory
doesn't work anymore with any version after 3.3.9, meaning it returns a 404 error.
I don't know if its just not calling the directory index or whatever but I always
had to call
http://domain.com/directory/
to get the wanted content.

For now I had to go back to 3.3.9 to avoid this problem.


Regards,

thomas

ts77
05-05-2008, 10:39 AM
anyone?
is that being taken care of for the next release or am I just too stupid to use a cool feature?

PSS
05-05-2008, 01:40 PM
Just checked and it works fine in v3.3.11 Ent.

http://photography-on-the.net/gallery
http://photography-on-the.net/gallery/

= same content.

Do you have something set up in virtual Hosts/Index Files settings (I have all "Not set")?

mistwang
05-05-2008, 09:17 PM
Sorry, forgot to update this thread.
Yes, it should have been fixed in 3.3.11

ts77
05-07-2008, 06:26 AM
hmm, just tested again with 3.3.11 with the same result.
digging deeper it seems to be a change in the mod rewrite handling.

there are cakephp rules in the .htaccess in that directory which lead to the following (from the error log with mod rewrite logging):

Access with
www.domainname/the_given_directory :
---
2008-05-07 15:16:42.556 [INFO] [xxx:14858-0#domainname] [REWRITE] Rule: Match '/the_given_directory' with pattern '(.*)pages/(.*)/foo', result: -1
...
2008-05-07 15:16:42.556 [INFO] [xxx:14858-0#domainname] [REWRITE] Source URI: '/the_given_directory' => Result URI: 'app/webroot/the_given_directory'
----

Access with
www.domainname/the_given_directory/ :
---
2008-05-07 15:17:42.564 [INFO] [xxx:14970-0#domainname] [REWRITE] Rule: Match '' with pattern '(.*)pages/(.*)/foo', result: -1
...
2008-05-07 15:17:42.564 [INFO] [xxx:14970-0#domainname] [REWRITE] Source URI: '' => Result URI: 'app/webroot/'
---

see the directory given as parameter in the first request?
I guess these two requests should be handled fully the same and I think the second way is the correct one.

mistwang
05-07-2008, 06:47 AM
Looks like we need to fully duplicate your server configurtion to reproduce it.
www.domainname/the_given_directory (http://www.domainname/the_given_directory) should be redirected to www.domainname/the_given_directory (http://www.domainname/the_given_directory)/ then processed with the rewrite rule.

ts77
05-07-2008, 07:01 AM
well, no magic involved, just tried with a default install.
enabled rewrite and .htaccess, put the htaccess into a directory, tried access with (second) and without / (first):

2008-05-07 15:58:31.714 [INFO] [xxx:19511-0#Example] [REWRITE] Rule: Match '/test/cake_1.1.19.6305' with pattern '^$', result: -1
2008-05-07 15:58:31.714 [INFO] [xxx:19511-0#Example] [REWRITE] Rule: Match '/test/cake_1.1.19.6305' with pattern '(.*)', result: 2
2008-05-07 15:58:31.714 [INFO] [xxx:19511-0#Example] [REWRITE] Source URI: '/test/cake_1.1.19.6305' => Result URI: 'app/webroot/test/cake_1.1.19.6305'
2008-05-07 15:58:31.714 [INFO] [xxx:19511-0#Example] [REWRITE] Last Rule, stop!
----
2008-05-07 15:58:33.682 [INFO] [xxx:19511-1#Example] [REWRITE] strip base: '/test/cake_1.1.19.6305/' from URI: '/test/cake_1.1.19.6305/'
2008-05-07 15:58:33.682 [INFO] [xxx:19511-1#Example] [REWRITE] Rule: Match '' with pattern '^$', result: 1
2008-05-07 15:58:33.682 [INFO] [xxx:19511-1#Example] [REWRITE] Source URI: '' => Result URI: 'app/webroot/'


you see the same behaviour.

mistwang
05-07-2008, 07:15 AM
I see. The first request should be redirect to the second one, should not go through the rewrite rule in .htaccess at all. I probably know what is the problem. will address it soon.

ts77
05-07-2008, 11:00 AM
thanks. looking forward to it.

mistwang
05-07-2008, 04:36 PM
OK, please download and try 3.3.12 release package, just change the version number in the download link.

ts77
05-08-2008, 02:16 AM
seems to work, thx.