mod_rewrite and subdirectory redirection

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
IMS_Scott
Regular
Posts: 6
Joined: Fri Jan 23, 2009 6:31 pm

mod_rewrite and subdirectory redirection

Post by IMS_Scott »

I am having an issue where sub-directories are redirecting to the blog page. I found the suggestion in the FAQ to use a .htaccess file in the sub-directory with "rewriteengine Off" to correct this, but that did not work. I dug into the issue further and found this thread:

http://board.s9y.org/viewtopic.php?f=2&t=14382

With some of the information there, I went and checked the Serendipity configuration and found, to my surprise, that mod_rewrite was already set as "disabled." That seemed to explain why the .htaccess directive was having no effect, but doesn't explain why the sub-directory is being re-directed in the first place.

I have since tried setting mod_rewrite on in the configuration and using the .htaccess file in the subdirectory to bypass it, but it still does not work. Can anyone shed some light on what may be happening here? Would you expect the subdirectory redirection to be a problem even when URL Rewriting is disabled? If so, how can I prevent it if it isn't mod_rewrite that is doing it? Or, if I enable URL Rewriting with mod_rewrite, can you think of any reason that the .htaccess directive in the subdirectory is not preventing the redirect (I have double-checked that the .htaccess file is being processed by the server, and other directives I place in it do take effect)?

Thanks!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: mod_rewrite and subdirectory redirection

Post by garvinhicking »

Hi!

With disabled mod_rewrite, this should definitely not happen. What's the URL exactly that does not work for you? It might be related to you not giving the full existing filename, and thus the "DirectoryIndex" directive takes place...

Also, check any .htaccess file in every directory leading up to your subfolder...

Rgeards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
IMS_Scott
Regular
Posts: 6
Joined: Fri Jan 23, 2009 6:31 pm

Re: mod_rewrite and subdirectory redirection

Post by IMS_Scott »

Hi Garvin,

Awesome, thanks. I was just using the path to the subdirectory (http://site/subdirectory/), relying on the index.htm file to pop up by default. If I put in the full path to the file (http://site/subdirectory/index.htm) it comes right up. That's with mod_rewrite and the .htaccess file both enabled; I will have to test again with mod_rewrite disabled just out of curiosity.

I have Serendipity installed to the root of the site, so if I am reading you right when you say "check any .htaccess file in every directory leading up to your subfolder" that would include the root, right? And I can't really mess with that one without screwing up the rest of the site, I imagine?

Cheers,

Scott
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: mod_rewrite and subdirectory redirection

Post by garvinhicking »

Hi!

In that case, a .htaccess in the subdir with "DirectoryIndex index.htm" should suffice. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply