Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess 2

Status
Not open for further replies.

dmears1

Technical User
Jun 18, 2003
208
US
I need to change the default directory page of our website. Currently the default page is index.html. I want to change it to morter.php. In the past I have done this by adding:

Code:
DirectoryIndex morter.php

to the .htaccess file. I have tried adding this to the current .htaccess file:

Code:
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>

<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

AuthName [URL unfurl="true"]www.morter.com[/URL]
AuthUserFile /.../.../.../.../../.../.../.../file.pwd
AuthGroupFile /.../.../.../.../.../.../.../.../file.grp

DirectoryIndex morter.php

After adding the DirectoryIndex line, I get the following error when navigating to the subdirectory /catalog which is our online store:

Code:
Forbidden
You don't have permission to access /catalog/ on this server.
---------
Apache/1.3.27 Server at [URL unfurl="true"]www.morter.com[/URL] Port 80

I have been unable to find any online documentation as to what could be causing this error. Any help or ideas would be appreciated. Thanks...

 
dmears1,

It sounds like a permissions problem with either the folder or the file. If you're able to access /catalog/index.html, then the problem is with /catalog/morter.php.

Wishdiak
A+, Network+, Security+, MCSA: Security 2003
 
Thanks for the help!
I've got it working now with you help. The links to the online store were to the /catalog subfolder without specifying /catalog/index.php. When I updated all links to /catalog/index.php instead of just /catalog it works fine. I din't fully understand why this makes a difference, but at least it is working.
Thanks again.

 
2 problems here.

Code:
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>

Thats telling the server to deny all request, but on the other hand allow all requests. It should be:

Code:
<Limit GET POST>
order deny,allow
deny from none
allow from all
</Limit>

Code:
DirectoryIndex morter.php

You mention that you want to change it to morter.php but then later say you had to add index.php to the URL for it to work, so I am not sure if you want index.php or morter.php. Change that to the following and you won't need to put index.php at the end of each URL:

Code:
DirectoryIndex morter.php index.php

Hope this helps

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Hey Wullie,
Thanks for your input. I had questions myself regarding the contradictory "deny from all - allow from all". I had asked the original developer about this and was told that these were "default" settings. I as hesitant to change it.
Sorry I wasn't more clear regarding the "index.php" vs. "morter.php" files. Let me try to explain better: The default page for was "index.html". I changed this to "morter.php". After doing this when I clicked on our "Products" link (which linked to I got the above mentioned error. Once I changed the link to I no longer received the error. I hope this better explains it.
Thanks again!


 
<facetious>
Was that actually Wullie posting? I though he had absconded to some jungle somewhere!
</facetious>

I've still been on TT, I don't use Apache really now (business is all IIS) so not really been in this forum too much. I don't mind IIS, but Apache is so much easier to work with.

Sorry I wasn't more clear regarding the "index.php" vs. "morter.php" files. Let me try to explain better: The default page for was "index.html". I changed this to "morter.php". After doing this when I clicked on our "Products" link (which linked to I got the above mentioned error. Once I changed the link to I no longer received the error. I hope this better explains it.

DirectoryIndex tells Apache what files to show if no filename is given in the URL. Because you only have morter.php then Apache can't find this file in the catalog directory and throws the error. If you put both index.php and morter.php in the DirectoryIndex as I mentioned above then you won't need to specify the filename in your links. Apache would look for morter.php and if it can't find that, it will look for index.php.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Thanks again Wullie. I didn't realize that the DirectoryIndex command, if contained in the root directory's .htaccess, would affect subdirectories. Thanks again for all of your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top