How to display .html page - php

I had a index.html page and index.php file are in the same folder .My folder name is Tester and also i had the sub domain with the same name. i am using the following URL www.Tester.hoster.com/ . My issue is, if i use the above link it directly show the .php file. how i display the .html page instead of .php page plz guide me thanks in advance

DirectoryIndex index.html
Add this in your .htaccess file

This is something that you need to update on your server. Depending on if you're using Windows ( IIS configurations should handle this ) or Linux (.htaccess should handle this)
.htaccess:
DirectoryIndex index.html
You can also add more file names/extensions after index.html, they will be treated by priority in the order in which you list them.
Not sure about ISS, sorry.

There are several ways to do it, URL Rewrite being a smart option.
A quick technique is to change the name of the index.php file to something else, say home.php.

Related

How to setup main page to show even when you just type the default folder containing it

For example this is what I type file:///C:/xampp/htdocs/At/html/ in the URL. I want the file:///C:/xampp/htdocs/At/html/pages-login.php to appear. How Can I do this?
The default page is index.html . But you can use any file as default by using .htaccess file.
Create an .htaccess file on C:/xampp/htdocs/At/html/ and put the code,
DirectoryIndex pages-login.php
Now the default loading page will be pages-login.php
The first file the server tries to load is index.html / index.php so on.
So simply renaming your file to index.html should solve that issue.
Alternatively you can keep a index.html which will redirect you to pages-login.html or by .htaccess file you can manage that behaviour.

site only shows all info from index.php?

Sorry if this is a basic question, but Im wondering why my site doesn't display correctly unless I utilize the index.php extension. Here is an example :
www.copishboutqiue.com/salon
which displays incorrectly but
www.copishboutique.com/salon/index.php displays the correct layout we're using. Why do I need to use the index.php when this is the only file in the root directory?
if you are using an apache server create a .htaccess file in the root directory of your website and add
DirectoryIndex index.php

Change default url from index.php to index.html in Joomla

I have a web-site created with Joomla. I have two different index pages. One of them is "index.php" and the other one is "index.html". I want to set default page as "index.html" when I browse the URL of the site (However, now, the active default page is index.php). I have a href from that .html page to index.php. I have not change the content of index.php.
How can I change it from a configuration page or something like that?
It depends on the web server you are using, if you are using Apache, it's the DirectoryIndex configuration you need to change, see here. For other types of server, I don't know, you'll need to read the docs.
Using an .htaccess file, you can change the index file to something else other than any of the index defaults. To do this, insert the below line into an .htaccess file.
DirectoryIndex index.html index.php

.htaccess use subdirectories files

hi all i am purely newbie to right .htaccess files. The issue is,
My base directory is http://localhost/mvctask/and i want to use the files of sub directory sub.
for example:
http://localhost/mvctask/ will be using http://localhost/mvctask/sub/login.php instead http://localhost/mvctask/login.php.
While url remain same as http://localhost/mvctask/. I need it to do without using rewrite-rules.
Please any help.
Edit:
I changed the index.php to login.php in edit. just because there is option to use DirectoryIndex mysubdir/index.php to change index .
I find the solution that same DirectoryIndex is working for all files. While previously i assumed that it works only for index files (may be i confused due to it's name :P ).
DirectoryIndex mysubdir/login.php

setting home (default) page in a directory

It's been a while since I created a new directory on my domain (call it my/domain/dir3). I have others, each containing a index.php (dir1/index.php - dir2/index.php), each index is called if the directory URL is called (thus a URL of my/domain/dir1 will call my/domain/dir1.index.php).
No the embarrasing part ... I've completely forgotten how I did this! ... blank .... nothing ... no recollection. Please somebody enlighten me.
If you use Apache, it does this automatically. You can tweak the settings in httpd.conf though.
Well if it's a standard Apache/PHP installation then putting an index.php file in the directory would make it the default page in a directory.
Oh, if you want a different file to be the index. Create a .htaccess file in the directory and enter this:
DirectoryIndex index.html index.htm index.php something.php
Replace something.php with the file you want and presto ;). You can't have two indexes.
If index.php is seen by Apache as the default index file, my/domain/dir1/ will see my/domain/dir1/index.php. If you want something more complex, You'll need mod_rewrite.

Categories