Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-07-09
5
Medium Priority
?
465 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 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 500 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 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