Page 1 of 1

Can I config. Apache to ignore .htaccess files?

PostPosted: 26. October 2009 17:30
by stuffdone
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

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

PostPosted: 27. October 2009 07:26
by Stepke-DSL

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

PostPosted: 27. October 2009 15:45
by stuffdone
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.

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

PostPosted: 27. October 2009 16:31
by Stepke-DSL
That is the english version...

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


Don't forget to restart Apache...

Stepke

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

PostPosted: 27. October 2009 16:45
by Nobbie
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?

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

PostPosted: 27. October 2009 17:01
by stuffdone
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....! :)

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

PostPosted: 27. October 2009 17:04
by stuffdone
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...

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

PostPosted: 27. October 2009 17:13
by stuffdone
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?