Solved

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

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WSUS Feature Updates for WIndows 10 6 105
Independent domain networks for setup 6 116
Unknown AD user under VMWare OU 4 58
Questions about DHCP migration 5 60
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 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