Trouble finding index page


#1

My website has its index.php file in an /html/ subdirectory, and I have tried several ways to get there by modifying .htaccess, but I can’t seem to get anything to work.

If I use…
DirectoryIndex index.php
… I get the browse directories page.

But if I do…
DirectoryIndex html/index.php
… it looks like I get to the right file, but I get a parse error in my php code which shouldn’t happen.

Furthermore, on my local machine I had…
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?localhost$ [NC]
RewriteCond %{REQUEST_URI} !^/html/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /html/$1
RewriteCond %{HTTP_HOST} ^(www.)?localhost$ [NC]
RewriteRule ^(/)?$ html/index.php [L]
… and using this one (replacing localhost with my subdomain), I get the same parse error.

When I host the file on my local machine, everything works in the same way I have it set up on the web, so I’m really at a loss to what could be wrong. My dreamhost account is a shared server, if that helps, and I can post php code too, but since it works on my localhost I’m not convinced that’s the problem. Thanks.

edit: I should add that the parse error I get is when I call a function from an included file that’s in an /includes directory.


#2

Putting the DirectoryIndex file in a separate directory is a pretty weird thing to do — is there some reason that you need to have this set up like this? If not, it’d simplify matters greatly to just put the index.php in the same directory that it’s supposed to be an index for.


#3

I keep them in separate directories just so it’s easier to manage the permissions for groups of different files. But, alas, even if I put index.php right in the subdomain directory I get the same error.


#4

cpil, that .htaccess looks like WordPress.

You should be able to do that: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install