Solved

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

Posted on 2009-07-09
5
459 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
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…

821 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