.htaccess tutorial

htaccess Elite


DirectoryIndex can point to external page also

Anything not fitting into other categories

DirectoryIndex can point to external page also

New postby produke » 27 Sep 2006 07:15

Normally DirectoryIndex is used like
Code: Select all
DirectoryIndex index.html index.php


This is especially useful when using
Code: Select all
Options -Indexes


Well this can also be used like this
Code: Select all
DirectoryIndex https://secure.example.com/login.php


This redirects all requests for https://secure.example.com/ or https://secure.example.com to https://secure.example.com/login.php

Cool huh? But you should actually just do

Code: Select all
DirectoryIndex login.php


The first example only comes in handy when you want to force http://www.example.com requests to a different domain like https://secure.example.com. Like if they both point to the same folder but are served on :443 and :80
User avatar
produke
 
Posts: 242
Joined: 25 Sep 2006 04:48

Return to Main