AllowOverride


#1

I’m trying to use AllowOverride in one of the subdirectories of my site.

Lets say my username is timmy while the domain is abc.com and the subdirectory is red-truck.

Wouldn’t the code look like this?:

<Directory /home/timmy/abc.com/red-truck>
AllowOverride All

I’ve successfully password protected all the folders on my site with an .htaccess file that looks something like this and located in abc.com:

<Files .htaccess>
order allow,deny
deny from all

AuthType Basic
AuthUserFile /home/timmy/.htpasswd
AuthName "Password Protected"
require user timmy

Disable directory listing from this point

Options -Indexes

the .htpasswd file is located in the root.

I get the following error when I try to access the page:

Internal Server Error


#2

Apache’s directive is meant to be used in the global or virtualhost configuration contexts, not in .htaccess files. This alone is what’s causing your error.

If you’re just trying to password protect one directory, remove that section and move the .htaccess file into the protected directory, then try it again. If all else fails, you can use DH’s control panel to write the .htaccess file for you.


If you want useful replies, ask smart questions.


#3

Thanks.

I guess the “Prevent .htaccess Override in Certain Directories.” section of the knowledgebase article “Various .htaccess samples and tutorials” is erroneous/misleading then?

https://panel.dreamhost.com/kbase/index.cgi?area=3083


#4

There are a few problems with that kbase article (not the least of which being that it looks like it was lifted in its entirety from another source). A lot of it is totally inapplicable to end users.

The section you copied, under “Prevent .htaccess Override in Certain Directories”, is not what you want. This is for web server administrators who want to prevent their users from using .htaccess. The rest of it should be fine.

Anyone from DH reading? That article could use some serious editing.


If you want useful replies, ask smart questions.


#5

Thats exactly why moving away from kbase to the wiki makes sense.

-Jason

I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(Neither of these sites are still hosted at dreamhost)


#6

/home/.barbie/twista/host.com/forums/

notice how “barbie” is in there for some reason? My php/mysql scripts will not work without the barbie part. :wink: Why did DH pick barbie as a name. LOL, when mysql goes down it gives an mysql error and it shows, “barbie” and my users prob thinking wtf

GottaDeal.com Deals & Coupon Codes. Why Pay Retail?


#7

Because why have just one person being wrong when you can have hundreds?

I joke. I’m actually a big fan of wikis and am working on two wiki-based projects as we speak, one for work, one personal. What I’m not a fan of, however, is official documentation being available only through them. Even if DH’s wiki really takes off, it’s no replacement for authoritative information like the knowledge base (assuming they fix things like this article). This is not to say it won’t be a great resource for non-official stuff though, like pretty much everything that’s there so far.


If you want useful replies, ask smart questions.


#8

mysql goes down it gives an mysql error and it shows, “barbie”

You should probably write your code so that script-generated errors go into your log but aren’t shown to users. Trap them and send more reasonable errors to the browser. Not only because you don’t want to give away too much behind-the-scenes information about your site, but because your users will appreciate a plain English explanation for the problem instead of something they don’t understand.


If you want useful replies, ask smart questions.


#9

mysql goes down it gives an mysql error and it shows, “barbie”

You should probably write your code so that script-generated errors go into your log but aren’t shown to users. Trap them and send more reasonable errors to the browser. Not only because you don’t want to give away too much behind-the-scenes information about your site, but because your users will appreciate a plain English explanation for the problem instead of something they don’t understand.

There is an english answer on the page. Its my forum which is “invision power board” :wink:

GottaDeal.com Deals & Coupon Codes. Why Pay Retail?