Solved

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

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

12 Experts available now in Live!

Get 1:1 Help Now