You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Lucioni Lorenzo <lu...@dsdata.it> on 2004/06/18 15:02:05 UTC

[users@httpd] regexp in Locationmatch

Hello, I hope you can help me. 
I have this problem: I need to tell, with regular expression, to apache LocationMatch, the following sentence:
 
"all starting with /abcd but not starting with /abcd/efgh"
 
Here is what I would to do (in boolean logic words):
     <LocationMatch "(/abcd) AND NOT (/abcd/efgh)">

I could do:
     <LocationMatch "/abcd/[^e][^f][^g][^h]">

but, of course, this solution is not good because it exclude also, for example:
     /abcd/aagh   (it should be not excluded)
 
I was hoping to find a rule, in regular expression rules, but I didn't find anything that permit me to exclude an entire word. Probably I can do it using regular expression in an advanced way but I'm not so practice with reg-exp.
 
Does Apache LocationMatch has an attribut such as "exclude-path", for example:
 
     <LocationMatch "/abcd">
     ....
     ....
     excludePath "/abcd/efgh"
     </LocationMatch>

Can you give me a suggestion?
 
Thank you very much,
Lorenzo
 

RE: [users@httpd] Getting index.php to display on 2.0 Upgrade

Posted by Bob Cohen <bc...@bpecreative.com>.
> Back to your original message:
> 
> > AddType AddType application/x-httpd-php .php .phtml
> > AddType application/x-httpd-php-source .phps
> 
> I hope that first line was a typo when writing the message. 
> Otherwise you have your problem with the extra "AddType".

My wife is right.  I am a lost cause.  ;-(.  Just when I thought I'd
plumbed the depths of my intellectual depravity, along comes another
stupid mistake.  That second AddType was causing the problem.  Thank
you.

Cheers,

Bob


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Getting index.php to display on 2.0 Upgrade

Posted by Robert Andersson <ro...@profundis.nu>.
Bob Cohen wrote:
> > That is not very descriptive. Do you get an error page (if so
> > what error), do you get the PHP page but unparsed?
> >
> > What are the corresponding log lines in access and error log?
>
> Now why didn't I think of that?  I am sys admin by necessity and a web
> designer by trade and bumble my way though these sorts of problems.
> Let's see.  The access log says:
>
> [18/Jun/2004:08:30:10 -0400] "GET /installation/index.php HTTP/1.1" 200
> 8078 "-" "Mozill
> a/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)"

That shows that there is no error, but what is it that you are getting here?
The unparsed PHP code?

> I did notice that my 1.3.x httpd.conf had this:
>
> <IfModule mod_dir.c>
>     DirectoryIndex index.html index.php
> </IfModule>

DirectoryIndex is not immediately relevant to the problem at hand.

Back to your original message:

> AddType AddType application/x-httpd-php .php .phtml
> AddType application/x-httpd-php-source .phps

I hope that first line was a typo when writing the message. Otherwise you
have your problem with the extra "AddType".

If that wasn't the reason, I don't know what else it could be. All you need
to add PHP support is the LoadModule and AddType directives.

Regards,
Robert Andersson


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Getting index.php to display on 2.0 Upgrade

Posted by Bob Cohen <bc...@bpecreative.com>.
> That is not very descriptive. Do you get an error page (if so 
> what error), do you get the PHP page but unparsed?
> 
> What are the corresponding log lines in access and error log?

Now why didn't I think of that?  I am sys admin by necessity and a web
designer by trade and bumble my way though these sorts of problems.
Let's see.  The access log says:

[18/Jun/2004:08:30:10 -0400] "GET /installation/index.php HTTP/1.1" 200
8078 "-" "Mozill
a/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)"

 
> 
> Have you loaded the PHP module?
> 

Yep there's a LoadModule directive in httpd.conf:

	LoadModule php4_module modules/libphp4.so

I did notice that my 1.3.x httpd.conf had this:

	<IfModule mod_dir.c>
    		DirectoryIndex index.html index.php
	</IfModule>

which, if my memory serves me correctly, was what fixed this problem the
last time I upgraded php.  There doesn't seem to be an analogous
statement in the 2.x httpd.conf. Instead, the DirectoryIndex directive
exists all by itself.  Could it be that I need to add an
"AddOutputFilter" directive?

Is this more helpful?

Cheers & Thank you,

Bob  


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Getting index.php to display on 2.0 Upgrade

Posted by Robert Andersson <ro...@profundis.nu>.
Bob Cohen wrote:
> I'm sorting through upgrading to 2.0.  For some reason, I can't get my
> index.php pages to display.

That is not very descriptive. Do you get an error page (if so what error),
do you get the PHP page but unparsed?

What are the corresponding log lines in access and error log?

> AddType AddType application/x-httpd-php .php .phtml
> AddType application/x-httpd-php-source .phps

Have you loaded the PHP module?

Regards,
Robert Andersson


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Getting index.php to display on 2.0 Upgrade

Posted by Bob Cohen <bc...@bpecreative.com>.
Hi,

I'm sorting through upgrading to 2.0.  For some reason, I can't get my
index.php pages to display. I've compared my 1.3.x httpd.conf with my
2.0.x httpd.conf and can't seem to find the missing bit of configuration
code.  I added "index.php" to the DirectoryIndex directive.  I also
added an AddType directive,

AddType AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

Now I'm scratching my head--so what else is new ;-)

Bob


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] regexp in Locationmatch

Posted by Robert Andersson <ro...@profundis.nu>.
[plain text, please...]

Lucioni Lorenzo wrote:
> I have this problem: I need to tell, with regular expression,

You know, the web is a wonderful place:
    http://www.perldoc.com/perl5.8.0/pod/perlre.html

> to apache LocationMatch, the following sentence:
>
> "all starting with /abcd but not starting with /abcd/efgh"

Perhaps this will do:

     <LocationMatch "^/abcd/(?!efgh)">

> Probably I can do it using regular expression in an advanced
> way but I'm not so practice with reg-exp.

Take a look in the above document, under look-ahead (negative) assertions.

Regards,
Robert Andersson

---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org