Then save it out as .htaccess and upload it to your website's main directory.

Now, it will first attempt to look for "index.html". If it doesn't exist, it will try to find "index.htm". If it can't find that one, it tries "index.php", and finally, if all else fails, "default.php". If it can't find any of the files mentioned above, it will usually come up with a page listing all the files in the directory, or "Directory Listing Denied" error page.

You can add any filenames you want to the .htaccess to tell it to look for, the nearer the beginning of the line, the higher priority it has.

So, in the example above, if you have both index.html and index.php in your root directory, if it finds index.html, it will display that and stop. index.php, in this case, will not be displayed unless you specifically put that filename in the URL. If you delete the index.html file, then it will display index.php by default.

conorific

Proficient

Posts: 350

Loc: NY

3+ Months Ago

That's right. I had posted a thread about this before, and I forgot that solution because it didn't work in my case. Thanks, Axe!

silentdreamer

Beginner

Posts: 61

Loc: Trapped in the mist of dark desires...

3+ Months Ago

thanks. I am not very good at this type of thing, so, my question may be a bit stupid. But if I am to have a Mod Rewrite in my htaccess. do i put your line before or after the mod rewrite? or does it actually matter?

Axe

Genius

Posts: 5735

Loc: Sub-level 28

3+ Months Ago

It shouldn't matter either way, but I'd probably put it at the top.

ATNO/TW

Super Moderator

Posts: 23454

Loc: Woodbridge VA

3+ Months Ago

Gentle reminder -- not every host is Linux. .htaccess won't work on a Windows server. If I'm wrong, someone please tell me how, because I can't figure it out.

b_heyer

Web Master

Posts: 4580

Loc: Maryland

3+ Months Ago

Well if your windows server is using Apache then it will work, as .htaccess is for apache.

Axe

Genius

Posts: 5735

Loc: Sub-level 28

3+ Months Ago

ATNO/TW wrote:

Gentle reminder -- not every host is Linux.

.htaccess will work on a Windows server, but only if it's running Apache for windows (afaik).

But still, if your site's being hosted on a non-*nix server. Find a new host

ATNO/TW

Super Moderator

Posts: 23454

Loc: Woodbridge VA

3+ Months Ago

*lol --that much I know -- but I haven't used a Windows server yet, that does. *sighs

ATNO/TW

Super Moderator

Posts: 23454

Loc: Woodbridge VA

3+ Months Ago

*lol --that much I know -- but I haven't used a Windows server yet, that does. *sighs BTW --AXE -- I specifically use Windows servers for ASP and .NET. Can't do that on Linux.

Axe

Genius

Posts: 5735

Loc: Sub-level 28

3+ Months Ago

You can do ASP on Linux, it just costs 600 bucks per server for the software licenses to support it

Besides, who needs ASP when you've got PHP? hehe

ATNO/TW

Super Moderator

Posts: 23454

Loc: Woodbridge VA

3+ Months Ago

I do. My company internal intranet, is already geared toward the .NET architecture, and I have no interest in changing that now.

silentdreamer

Beginner

Posts: 61

Loc: Trapped in the mist of dark desires...

3+ Months Ago

anyone else here using Myprohost.com as their host? I am completely confused by their registration processes... I now made my purchase and recieved a product confirmation e-mail, so... are they gonna e-mail me again when my little account is ready? will they make me a username AND make me a password? when i register a domain name elsewhere, what should i do?

Axe

Genius

Posts: 5735

Loc: Sub-level 28

3+ Months Ago

They don't create the username & password for you, you have to tell them what it is...

Basically, the way I do it, is to buy my domain names, pointing the DNS at the host I know I'm going to be getting. THen, in a couple of days after DNS has propagated, on the MyProHost.com order form, I enter the name of the domain and the username & password I wish to use for the account.

Then that's good.

If you don't already have your domain name yet, if you've already paid for your hosting, but didn't supply then with a domain name, don't worry, just go ahead and register the domain name you want to use, and then pop them an E-Mail (if they don't send you one first)

silentdreamer

Beginner

Posts: 61

Loc: Trapped in the mist of dark desires...

3+ Months Ago

done and done thanks! Now, I just wait for more replies from myprohosing.com:lol: