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
Related
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.
Ok, I am very new to web development, so excuse that. I set up my webserver using a Linode Stackscript (LAMP). However, my webpage doesn't display my actual index.php file, instead, it displays http://www.imgbomb.com/i/?lBqKe. Why is this? My index.php is inside my www. When I type /index.php after the url, I get a the page you are looking for is not found.
You should add DirectoryIndex index.php to your .htaccess file or webserver configuration file.
I have a wordpress site http://hamroletang.com and it contain a file http://hamroletang.com/sardanjali.html
Now I want sardanjali.html to be my website landing page.
Then it will redirect to index.php which i have done already
The easiest way would be to rename sardanjali.html to index.html and add:
<meta http-equiv="refresh" content="5;URL='http://hamroletang.com/index.php'">
Then, make sure that in your Apache config .html takes precedence over .php
You can rename sardanjali.html to index.html and then change in the apache config the directory index to have index.html before index.php:
DirectoryIndex index.html index.php
On my system this was already the default (ubuntu).
In your redirect you should explicitly redirect to index.php, and not to the domain in general.
If you cannot change apache config files and renaming to index.html doesn't help, then you can move your blog to a subdomain or subdirectory and redirect into that. But that would break all the links to your blog. Probably not what you want.
You can change the default page of your website to whatever you want it to be. In your case specify the single file sardanjali.html as your default page. The settings vary between web servers. e.g. on Apache here are the instructions - http://www.cyberciti.biz/faq/apache-display-or-change-a-default-page-other-than-indexhtml/
And yes, you have to use the refresh in your sardanjali.html to automatically redirect the user to your index.php after the specified time.
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.
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.