Can I config. Apache to ignore .htaccess files?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can I config. Apache to ignore .htaccess files?

Postby stuffdone » 26. October 2009 17:30

Can I config. Apache to ignore .htaccess files?

I have most sites to rewrite to include the "www." ahead of domain names if they are not included by the viewer. ( SEO thing ) but this means local viewing is not possible because I am redirected by .htaccess to the online site on my production server.

I don't want to remove or rename these files locally so prefer to find a way to tell Apache to ignore .htaccess files or at least the redirection. I could not make heads or tails out of the Apache web site in this regard. :oops:

1st Choice is for .htaccess files to function but to block page re-directions. 2nd choice is to block all .htaccess if the first option in not possible.

Thanks. :D
stuffdone
 
Posts: 10
Joined: 26. October 2009 00:16
Location: NE Florida

Re: Can I config. Apache to ignore .htaccess files?

Postby Stepke-DSL » 27. October 2009 07:26

Stepke-DSL
 
Posts: 313
Joined: 12. July 2007 16:08
Operating System: Win XP Pro SP3 + SuSe Linux

Re: Can I config. Apache to ignore .htaccess files?

Postby stuffdone » 27. October 2009 15:45

Stepke-DSL wrote:DOCU


Is there an "english" version? I don't see anything in there about turning off the use of .htaccess in Apache ? :oops:

Thanks.
Web Designer since 1995 ( http://www.stuffdone.com ).
Please assume I don't know this stuff, because I don't
stuffdone
 
Posts: 10
Joined: 26. October 2009 00:16
Location: NE Florida

Re: Can I config. Apache to ignore .htaccess files?

Postby Stepke-DSL » 27. October 2009 16:31

That is the english version...

Try
Code: Select all
<Directory c:/xampp/htdocs>
      AllowOverride None
</Directory>


Don't forget to restart Apache...

Stepke
Stepke-DSL
 
Posts: 313
Joined: 12. July 2007 16:08
Operating System: Win XP Pro SP3 + SuSe Linux

Re: Can I config. Apache to ignore .htaccess files?

Postby Nobbie » 27. October 2009 16:45

stuffdone wrote:Is there an "english" version?


Which language is this - not english??

AllowOverride directive
Syntax: AllowOverride All|None|directive-type [directive-type] ...
Default: AllowOverride All
Context: directory
Status: core

When the server finds an .htaccess file (as specified by AccessFileName) it needs to know which directives declared in that file can override earlier access information.

Note: AllowOverride is only valid in <Directory> sections, not in <Location> or <Files> sections, as implied by the Context section above.

When this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.

When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files.

The directive-type can be one of the following groupings of directives.

AuthConfig
Allow use of the authorization directives (AuthDBMGroupFile, AuthDBMUserFile, AuthGroupFile, AuthName, AuthDigestRealmSeed, AuthType, AuthUserFile, Require, etc.).
FileInfo
Allow use of the directives controlling document types (AddEncoding, AddLanguage, AddType, DefaultType, ErrorDocument, LanguagePriority, etc.).
Indexes
Allow use of the directives controlling directory indexing (AddDescription, AddIcon, AddIconByEncoding, AddIconByType, DefaultIcon, DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, ReadmeName, etc.).
Limit
Allow use of the directives controlling host access (Allow, Deny and Order).
Options
Allow use of the directives controlling specific directory features (Options and XBitHack).

Example:

AllowOverride AuthConfig Indexes

See Also: AccessFileName and Configuration Files



stuffdone wrote: I don't see anything in there about turning off the use of .htaccess in Apache ? :oops:


Probably you are blind!? Try to read this (quoted from above):

When this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.


Can you see that now? Or need more help?
Nobbie
 
Posts: 8761
Joined: 09. March 2008 13:04

Re: Can I config. Apache to ignore .htaccess files?

Postby stuffdone » 27. October 2009 17:01

Stepke-DSL wrote:That is the english version...

Try
Code: Select all
<Directory c:/xampp/htdocs>
      AllowOverride None
</Directory>


Don't forget to restart Apache...

Stepke


Thanks....! :)
Web Designer since 1995 ( http://www.stuffdone.com ).
Please assume I don't know this stuff, because I don't
stuffdone
 
Posts: 10
Joined: 26. October 2009 00:16
Location: NE Florida

Re: Can I config. Apache to ignore .htaccess files?

Postby stuffdone » 27. October 2009 17:04

Nobbie wrote:
stuffdone wrote:Is there an "english" version?


Which language is this - not english??

AllowOverride directive
Syntax: AllowOverride All|None|directive-type [directive-type] ...
Default: AllowOverride All
Context: directory
Status: core

When the server finds an .htaccess file (as specified by AccessFileName) it needs to know which directives declared in that file can override earlier access information.

Note: AllowOverride is only valid in <Directory> sections, not in <Location> or <Files> sections, as implied by the Context section above.

When this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.

When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files.

The directive-type can be one of the following groupings of directives.

AuthConfig
Allow use of the authorization directives (AuthDBMGroupFile, AuthDBMUserFile, AuthGroupFile, AuthName, AuthDigestRealmSeed, AuthType, AuthUserFile, Require, etc.).
FileInfo
Allow use of the directives controlling document types (AddEncoding, AddLanguage, AddType, DefaultType, ErrorDocument, LanguagePriority, etc.).
Indexes
Allow use of the directives controlling directory indexing (AddDescription, AddIcon, AddIconByEncoding, AddIconByType, DefaultIcon, DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, ReadmeName, etc.).
Limit
Allow use of the directives controlling host access (Allow, Deny and Order).
Options
Allow use of the directives controlling specific directory features (Options and XBitHack).

Example:

AllowOverride AuthConfig Indexes

See Also: AccessFileName and Configuration Files



stuffdone wrote: I don't see anything in there about turning off the use of .htaccess in Apache ? :oops:


Probably you are blind!? Try to read this (quoted from above):

When this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.


Can you see that now? Or need more help?


Thanks to Stepke-DSL who understood that I did not understand all the "technical" stuff provided me with an answer I could use...
stuffdone
 
Posts: 10
Joined: 26. October 2009 00:16
Location: NE Florida

Re: Can I config. Apache to ignore .htaccess files?

Postby stuffdone » 27. October 2009 17:13

Stepke-DSL wrote:That is the english version...

Try
Code: Select all
<Directory c:/xampp/htdocs>
      AllowOverride None
</Directory>


Don't forget to restart Apache...

Stepke


I added that...path corrected to my system, in httpd.conf but it did not solve anything. Page still redirects to production site online. Yes did restart apache. Here is the default entry above. It also contained the None. Am I missing something? Thanks.

Code: Select all
Default

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>


Code: Select all
New

<Directory g:/server/xampp/htdocs>
      AllowOverride None
</Directory>


Should I comment out the default?

Hmmm?
Web Designer since 1995 ( http://www.stuffdone.com ).
Please assume I don't know this stuff, because I don't
stuffdone
 
Posts: 10
Joined: 26. October 2009 00:16
Location: NE Florida


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 43 guests