You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jobarr <jo...@herzeleid.com> on 2001/12/11 03:01:32 UTC

Apache 2 directory/files

With apache 1.3.x I used the PHP module and a little trick to pass variables to a PHP script without a "?".

I have a script with no extension in the root directory called "en". I use the .htaccess file to tell Apache that this is a PHP file. All pages on my site go through this script. The URI of "/en/about" runs the "en" script and then it looks at "about" and displays the correct file. All other pages are similar.

For some reason, with apache 2 (at least 2.0.30-dev) it gives me a 404 page. This must be a problem with Apache because any file with a "/" after it gives a 404 error instead of displaying that file. "/index.html/text" would display "index.html" with 1.3.22, but it just gives a 404 in Apache 2.

Is this a "feature" or bug of Apache 2? Can it be changed?
-Jobarr


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Apache 2 directory/files

Posted by Jobarr <jo...@herzeleid.com>.
> Most likely, you have all your html files processed by mod_include.
> > Plain static text processed by the default handler will not allow that.

Ahh! You are right! I forgot about that :D
Either way, mod_include just would need to be changed to act as I said, keep cutting off parts until it gets a real file or folder.

-Jobarr


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Apache 2 directory/files

Posted by Joshua Slive <jo...@slive.ca>.

On Mon, 10 Dec 2001, Jobarr wrote:

> > Hmmm.  This could be a result of the fact that PHP is now a filter rather
> > than a handler.
>
> But like I said, it worked with HTML files with 1.3.22, at least on my
> computer (I might have changed something in the config that let it
> work, not sure).

Most likely, you have all your html files processed by mod_include.

Plain static text processed by the default handler will not allow that.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Apache 2 directory/files

Posted by Jobarr <jo...@herzeleid.com>.
> Hmmm.  This could be a result of the fact that PHP is now a filter rather
> than a handler. 

But like I said, it worked with HTML files with 1.3.22, at least on my computer (I might have changed something in the config that let it work, not sure). I don't mean that I was trying to pass variables to the HTML files, but if you typed in www.example.com/index.html/foo/bar it would still show "index.html" if foo and bar didn't exist. Something like...it would keep cutting off parts of the URI until it found a folder or file that existed. Now with Apache2, it just gives up if it doesn't find the last part.

I imagine if this was fixed/changed, then "/en/foo/bar" would eventually get back to my "en" script and then it would just look at $REQUEST_URI (which would have "/en/foo/bar" in it), like I currently do, and everything would work.


thanks
-Jobarr


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Apache 2 directory/files

Posted by Mark Constable <ma...@renta.net>.
On Tue, 11 Dec 2001 12:34, Joshua Slive wrote:
> ...
> If you want, however, I can suggest some work-arounds using AliasMatch or
> or mod_rewrite to turn the PATH_INFO into QUERY_STRING.  Something like:
>
> RewriteRule ^/en(.*) /path/to/real/script?$1
>
> Of course, you'll need to change your scripts to look in QUERY_STRING
> instead of PATH_INFO, which could be a real pain.

And that blows away one of the main reasons for doing
this... search_engine_friendly URLs. I've found the
simplest a least stuffupable solution is to simply
use folders... ie; if en/ is a folder with an index.*
file then it simply works as expected in all cases
without any kludges.

Any response on this issue of PHP being classed as
a filter versus a handler in apache2 would be most
appreciated.

--markc

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Apache 2 directory/files

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 10 Dec 2001, Jobarr wrote:
>
> For some reason, with apache 2 (at least 2.0.30-dev) it gives me a 404
> page. This must be a problem with Apache because any file with a "/"
> after it gives a 404 error instead of displaying that file.
> "/index.html/text" would display "index.html" with 1.3.22, but it just
> gives a 404 in Apache 2.
>
> Is this a "feature" or bug of Apache 2? Can it be changed?

Hmmm.  This could be a result of the fact that PHP is now a filter rather
than a handler.  PATH_INFO (the stuff beyond the real filename) is allowed
only for dynamic-content handlers.  In other words, you can't tag stuff
onto a plain html file.  Now that PHP is a filter, the file it is
processing may no longer be considered dynamic, so it may not get the
PATH_INFO.  I'll forward this over to the development list to see if they
have any ideas.

If you want, however, I can suggest some work-arounds using AliasMatch or
or mod_rewrite to turn the PATH_INFO into QUERY_STRING.  Something like:

RewriteRule ^/en(.*) /path/to/real/script?$1

Of course, you'll need to change your scripts to look in QUERY_STRING
instead of PATH_INFO, which could be a real pain.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org