Solved

.htaccess , Apache 2.2.4 on Windows Server (for testing)

Posted on 2009-07-09
5
457 Views
Last Modified: 2012-05-07


Hello,

I am having a little bit of a problem with my httpd.conf settings with Apache.

When I set AllowOverride All in the httpd.conf  it seems mod_rewrite works fine, but it then seems to actually read the .php files contents rather than execute the code. It's pretty weird.

When I set AllowOverride to  "AllowOverride AuthConfig"  I get a 500 error :

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.


In my error_log  I get the error:  

[Thu Jul 09 00:23:04 2009] [alert] [client 127.0.0.1] C:/Apache2/htdocs/ediamondauction/wwwroot/.htaccess: RewriteEngine not allowed here .

Awkward how when i use AuthConfig it seems to not work properly. Do I have to setup some configuration rules in the .htaccess file itself in order for it rewrite url's properly?

Any help is greatly appreciated.
0
Comment
Question by:HelpTheMan
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
caterham_www earned 125 total points
ID: 24813339
> when i use AuthConfig it seems to not work properly

No, because the directives provided by mod_rewrite override FileInfo and not AuthConfig.

> but it then seems to actually read the .php files contents rather than execute the code

I.e. you've a buggy .htaccess file somewhere with some AddHandler/AddType/SetHandler/ForceType directive overriding your "AddHandler handler .php" defined in your httpd.conf.
0
 

Author Comment

by:HelpTheMan
ID: 24815519
Ok I'd like to update you guys.  The PHP scripts are executing fine, it was just that php was not allowing the old tags :  "<?"  ... I got .htaccess working. What seems to actually be the problem is...


When referencing   something like "/images/blah.jpg"  apache seems to be reading that as "Let's find the images directory in the root directory"  I don't understand why it would act this way.

Normally you create sub directories in a website and just do a call like "/images/blah.jpg"  and it will assume you're talking about the current working directory.  I guess you could do "./images/blah.jpg"  but I don't want to have to make this change as it will effect quite a lot of things.

Could anyone help on this? The help is much appreciated.
0
 
LVL 27

Assisted Solution

by:caterham_www
caterham_www earned 125 total points
ID: 24821349
>"/images/blah.jpg"  apache seems to be reading that as "Let's find the images directory in the root directory"

That's what the browser requests and the server serves. If you'd like to put the /images directory somewhere else, use an Alias in your httpd.conf:
Alias /images "C:/Apache2/htdocs/ediamondauction/wwwroot/some/folder/images"

Open in new window

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now