Jump to content

[SOLVED] .htaccess question


ratcateme

Recommended Posts

I haven't really used .htaccess to much in the recent past and i am having some trouble blocking the include files from being read i have this in my .htaccess file

<Directory /var/www/html/notes/>
        <Files .inc>
                Order Allow,Deny
                Deny from all
        </Files>
</Directory>

thinking that should block all files ending in .inc but when i go to /notes/xajax.inc i can view the file.

where have i gone wrong?

 

Scott.

 

Link to comment
Share on other sites

thanks thorpe but still not working i put that and only that in /var/www/html/notes/.htaccess

and still nothing i can still view all my .inc files

i also tried

<Directory /var/www/html/notes/>
  <Files "*.inc">
    Order Allow,Deny
    Deny from all
  </Files>
</Directory>

and without the <Directory> parts and without the quotes but i am a real beginner with htaccess and i can't seem to be able to work out how they should be used the google examples also seem a bit strange to me.

i also check thought the server config and confirmed:

AccessFileName .htaccess

 

Scott.

 

Link to comment
Share on other sites

not working eithre before i tried that i went through my server config again it is a new server and found that AllowOverride was set to none on / and /var/www/html

i have set both to all and still wont work is there any way i can confirm my htaccess file is being run?

i am using apache 2.2

 

Scott.

Link to comment
Share on other sites

i tied that no luck i even added that to the bottom of my httpd.conf file and still nothing i can view all the files ending in .inc

i even cleared the .htaccess file and restarted httpd and i can still view all of them

where could i possible be missing something?

i check /var/www/html/ and there are no htaccess files there

i have absouly no clue what is going on

 

Scott.

Link to comment
Share on other sites

found the problem while looking through my configs i had one:

<Location />
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 10.
</Location>

basically to block the entire server from the internet for the time but should that be overridden by the htaccess file?

because as soon as i comment those lines out i get a 403 but when they are there it loads no problems

is there a better way to block my site from the internet temporally but still have the htaccess configs working?

or should i just take the port forward from my router?

 

Scott.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.