Htaccess / mod_rewrite problems with possible subdirectories?

I don't think this is possible. But this sounds like a construction error either way. It would be much better to incorporate the two .

Htaccess files into one. (Or is the second one in somepath even necessary? Why?) Under which circumstances does the request's domain point to somepath?

Is it a different domain you could use in a RewriteCond of its own?

I don't think this is possible. But this sounds like a construction error either way. It would be much better to incorporate the two .

Htaccess files into one. (Or is the second one in /somepath even necessary? Why?) Under which circumstances does the request's domain point to /somepath?

Is it a different domain you could use in a RewriteCond of its own?

The pointing of the domain into /somepath is a user choice which I can not control. And thats when its needed in /somepath. – komakino Aug 13 '10 at 8:24 1 @komakino - When the domain is pointed at /somepath, does /somepath become the DocumentRoot?

Also, does uri_handler. Php care what directory it's in, or regardless of where the domain points, can it do its job no matter where it's located? – Tim Stone Aug 13 '10 at 8:34 @komakino so it doesn't work to simply remove the htaccess in /somepath?(Not sure right now where it will look for the relatively specified uri_handler.

Php in that case. ) – Pekka Aug 13 '10 at 8:34 @Tim - Yes, it becomes the document root. The uri_handler could do its job either way but it brings other logical problems for me that are hard to explain.

@Pekka - I cant remove it since I do not know if it is needed. Oh, there are uri_handlers in both directories. – komakino Aug 13 '10 at 8:41 @komakino you can remove it: .

Htaccess files apply to all child directories. A request to /somepath will be caught by the htaccess file in the parent directory. The only question is whether the RewriteRule will be parsed correctly (i.e.

Whether the url_handler. Php reference points to the correct file) – Pekka Aug 13 '10 at 8:44.

Barring any attempts at simplifying your setup, I think that the easiest approach here is to just make sure that the . Htaccess file in /somepath doesn't handle requests to /somepath when the document root is /. Assuming we're all on the same page about the document root, we can accomplish this by modifying /somepath/.

Htaccess: Edit: The easier way is to just have it always request the uri_handler. Php that lives at the root: RewriteEngine On RewriteCond %{REQUEST_FILENAME}! -f OR RewriteCond %{REQUEST_FILENAME} \.

Php$ RewriteRule . * /uri_handler. Php L.

I already tried that, but the rewrite logic in /. Htaccess is still ignored. So I just get a regular 404.

– komakino Aug 13 '10 at 9:16 I mean I get a regular 404 when requesting a fake uri like /somepath/foo/bar. When requesting /nonexistantpath/foo/bar the logic in /. Htaccess works fine.

– komakino Aug 13 '10 at 9:18 Hmm, you're right. I'm going to have to go back and double-check the source code on this one, since it's definitely not what I had anticipated. Interesting.

I'll edit with a fix, though. – Tim Stone Aug 13 '10 at 9:27 @komakino - And actually...I think it can be done as easily as adding the forward slash, regardless, whoops. – Tim Stone Aug 13 '10 at 9:30 First of all, I get a 500 with log entry "Request exceeded the limit of 10 internal redirects due to probable configuration error.

Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. " Secondly - I know this is a pain in the a** - I also need to support the whole system to be placed in a subdir.

Then the upper uri_hanlder would not be in the doc root either ;) – komakino Aug 13 '10 at 9:40.

I am working on a very dynamic system where I have two identical htaccess files in / and in /somepath. The reason for this that the domain could be pointed into /somepath, but I never know if it is. When it is pointed to /somepath there are no problems, but when its not it seems like when I request /somepath/page/foo/bar the htaccess file in /somepath overrides the one in /.

In the latter case I don't want the /somepath/. Htaccess to run at all, or at least disregard the mod_rewrite in it. One solution would be if I could check if the latter htaccess is not located in the document root.

Is this possible? How can I compare the htaccess path to document root from within the htacces file? Does anyone know whats going on here?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions