.htaccess problem


#1

It seems like almost anything I’ve ever tried with .htaccess either a) causes a 500 error or b) causes no error but doesn’t work

I’m trying to change the default page in my site’s root directory (wayfs.com/) without affecting the other directories. Right now I have the following code in my .htaccess in my site folder:

<Directory /wayfs.com>
DirectoryIndex educational.html

I’ve also tried

DirectoryIndex educational.html DirectoryIndex educational.html

<Directory /wayfs.com/>
DirectoryIndex educational.html

Every one of these causes a 500 error. What’s the deal?


#2

try to place the .htaccess file in wayfs.com folder with

DirectoryIndex educational.html

$50 off and 3 free domains with code: [color=#CC0000]DH3[/color] Sign Up NOW or More Codes Here


#3

If I do that it affects all the subdirectories too.

(Plus at this point I don’t care about the general problem, I just want to know why this one command isn’t working the way it should.)


#4

[quote]<Directory /wayfs.com/>
DirectoryIndex educational.html

Every one of these causes a 500 error. What’s the deal?[/quote]
Failure to read the documentation. That directive is not available for per-directory configuration files (aka .htaccess)

You will need to use mod_rewrite instead, something like

RewriteEngine On
RewriteRule ^/$ /education.html

:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


#5

Thanks for your help.

Where does it say that?


#6

Depends what part he was talking about. If he meant , it says right here that you can only have a block in the server or VirtualHost configuration, neither of which we have access to as users. However, if he meant DirectoryIndex, which is sort of what the rest of his post makes it look like, the answer is nowhere; you’re fully welcome to use DirectoryIndex in your .htaccess files.


#7

Also instead of re-writing the URL you can send a redirect instead:

RedirectMatch ^/$ /education.html

:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


#8

Makes sense. Thanks for all your help, guys.