htaccess in a folder

hi

in

/srv/www/htdocs/tale

i have a .htaccess

how to enable it?

i don’t changed anything in


/etc/apache2/httpd.conf
/etc/apache2/default-server.conf

thanks

collinm wrote:

>
> hi
I have this in my httpd.conf:

use .htaccess files for overriding,

AccessFileName .htaccess

and never show them

<Files ~ “^.ht”>
Order allow,deny
Deny from all
</Files>

It seems to work well enough. But, httpd.conf calls on default-
server.conf, so it should also work if you put it in there instead and
the statement to include default-server.conf isn’t commented out.
There are other ways as well of accomplishing what htaccess does, but
for some tasks, htaccess is just simpler to use.

>
> in
>
> /srv/www/htdocs/tale
>
> i have a .htaccess
>
> how to enable it?
>
> i don’t changed anything in
>
>
> Code:
> --------------------
>
> /etc/apache2/httpd.conf
> /etc/apache2/default-server.conf
>
> --------------------
>
>
> thanks
>
>

a part of my /etc/apache2/httpd.conf


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

AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

a part of my /etc/apache2/default-server.conf


<Directory "/srv/www/htdocs">
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs-2.2/mod/core.html#options
        # for more information.
        Options None
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        AllowOverride None
        # Controls who can get stuff from this server.
        Order allow,deny
        Allow from all
</Directory>


it’s the default opensuse value…because i don’t changed theses file

my htaccess file - /srv/www/htdocs/thelia


Options +FollowSymlinks
RewriteEngine on

#CONTENU
#############
RewriteRule   ^([a-z0-9-]*)__([0-9]*)_([a-z0-9-]*)_([0-9]*)\.html  contenu.php?id_contenu=$4  [NC,QSA,L]

#RUBRIQUE
##############

RewriteRule   ^([a-z0-9-]*)_([0-9]*)_([a-z0-9-]*)_([a-z0-9-]*)_\.html  rubrique.php?id_rubrique=$2  [NC,QSA,L]
RewriteRule   ^([a-z0-9-]*)_([0-9]*)_([a-z0-9-]*)_\.html  rubrique.php?id_rubrique=$2  [NC,QSA,L]
RewriteRule   ^([a-z0-9-]*)_([0-9]*)_\.html  rubrique.php?id_rubrique=$2  [NC,QSA,L]


#PRODUIT
#############
RewriteRule   ^([a-z0-9-]*)_([0-9]*)_([a-z0-9-]*)_([a-z0-9-]*)__(^.]*)\.html  produit.php?ref=$5&id_rubrique=$2  [NC,QSA,L]
RewriteRule   ^([a-z0-9-]*)_([0-9]*)_([a-z0-9-]*)__(^.]*)\.html  produit.php?ref=$4&id_rubrique=$2  [NC,QSA,L]
RewriteRule   ^([a-z0-9-]*)_([0-9]*)__(^.]*)\.html  produit.php?ref=$3&id_rubrique=$2  [NC,QSA,L]

if i put my htaccess file in /srv/www/htdocs/thelia

i get:


Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

any idea?

a2enmod rewrite
rcapache2 restart

ok now i get:

[Sun Aug 09 16:15:07 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sun Aug 09 16:15:07 2009] [notice] Apache/2.2.10 (Linux/SUSE) mod_ssl/2.2.10 OpenSSL/0.9.8h PHP/5.2.9 with Suhosin-Patch configured -- resuming normal operations
[Sun Aug 09 16:15:43 2009] [error] [client 127.0.0.1] File does not exist: /srv/www/htdocs/thelia/sac-a-dos_19_touring_asolo-encounter__asoloencounter60.html, referer: http://localhost/thelia/produit.php?ref=ASOLOENCOUNTER60&id_rubrique=19

any idea?

is it the htaccess who is the problem?

If you want .htaccess to work you must allow override for the thelia directory, otherwise it ignores the directives inside it.

Which conf file needs AllowOverride All in order to process .htaccess fiels in users public_html and sub folders ?

Hope someone can confirm I have done this the correct way!

I edited /etc/apache2/mod_userdir.conf and changed

AllowOverride All
Options All

Now I do not get Internal Serrver Errors when I have a .htaccess file in my user/public_html directories

???
Thanks

EDIT: The text below NOT true. Please see the next post where this post is corrected

On Tue, 22 Feb 2011 22:36:03 +0530, Ski K2
<Ski_K2@no-mx.forums.opensuse.org> wrote:

>
> Hope someone can confirm I have done this the correct way!
>
> I edited /etc/apache2/mod_userdir.conf and changed
>
> AllowOverride All
> Options All
>
> Now I do not get Internal Serrver Errors when I have a .htaccess file
> in my user/public_html directories

i’m afraid that, depending on your apache2 configuration, this won’t work.
i suspect you’re not getting an error because that file, mod_userdir.conf,
isn’t pulled into the standard config file (/etc/apache2/httpd.conf) –
this option is commented out. i also don’t think that this is what
mod_userdir.conf is supposed to do.

if you want to set that option, to allow .htaccess to modify permissions,
server-wide i would set it directly in httpd.conf, where it says:


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

changing “AllowOverride None” to “AllowOverride All”, or whatever
permissions you want to allow.

otherwise, if you have enabled different virtual hosts, in
/etc/apache2/vhosts.d/<your-virtual-server>.conf


phani.

EDIT: The above is NOT true. Please see the next post where this post is corrected

I’M SORRY, PLEASE DISREGARD MY PREVIOUS POST, IT’S NONSENSE!

if your apache2 server is using default settings, which mine isn’t, you
SHOULD be doing exactly what you said: change the AllowOverride value in
mod_userdir.conf. doing what i wrote earlier would leave your system open
to all types of attacks, especially if your webserver is accessible over
the internet.

in this case you would set up your website in your home directory, i.e.,
/home/<your-user-name>/public_html, as it’s supposed to be. but you’d have
to make sure that the mod_userdir module is enabled, of course.


phani.

On Tue, 22 Feb 2011 23:14:47 +0530, phanisvara <listmail@phanisvara.com>
wrote:

> On Tue, 22 Feb 2011 22:36:03 +0530, Ski K2
> <Ski_K2@no-mx.forums.opensuse.org> wrote:
>
>>
>> Hope someone can confirm I have done this the correct way!
>>
>> I edited /etc/apache2/mod_userdir.conf and changed
>>
>> AllowOverride All
>> Options All
>>
>> Now I do not get Internal Serrver Errors when I have a .htaccess file
>> in my user/public_html directories
>
>
> i’m afraid that, depending on your apache2 configuration, this won’t
> work. i suspect you’re not getting an error because that file,
> mod_userdir.conf, isn’t pulled into the standard config file
> (/etc/apache2/httpd.conf) – this option is commented out. i also don’t
> think that this is what mod_userdir.conf is supposed to do.
>
> if you want to set that option, to allow .htaccess to modify
> permissions, server-wide i would set it directly in httpd.conf, where it
> says:
>
>


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

>
> changing “AllowOverride None” to “AllowOverride All”, or whatever
> permissions you want to allow.
>
> otherwise, if you have enabled different virtual hosts, in
> /etc/apache2/vhosts.d/<your-virtual-server>.conf
>


phani.