Is it possible to load different index file on front page and still look like default site name in browser, i.e. www.mysite.com for index.html and www.mysite.com for index2.html ?
Asked
Active
Viewed 1,102 times
0
-
yes. using .htaccess file – egig Mar 13 '13 at 12:06
-
When you say "front page", do you mean you are using [MS FrontPage](http://en.wikipedia.org/wiki/Microsoft_FrontPage) on the server or do you just mean the "first page". – oatsoda Mar 13 '13 at 12:06
-
I mean my website index.html that loads first. I need another index2.html file that will load when triggered (by a button from another page) but the browser to look the same www.mysite.com and not www.mysite.com/index2.html. How can be done with .htaccess file ? – marius Mar 13 '13 at 12:25
-
I managed to add this rule in .htaccess 'DirectoryIndex index.html index2.html' But I need to add a link on my site that will load index2.html while the browser will show mysite.com alone. How to do that? – marius Mar 13 '13 at 12:49
-
try find about 'mod_rewrite', hopely useful – egig Mar 13 '13 at 14:18
-
The OP wants **both** files to be displayed under the the pathless domain, so .htaccess or mod_rewrite will not help. The only way is to load the content dynamically using AJAX. Or if it was 1994 you would use a frame! – oatsoda Mar 13 '13 at 16:17
1 Answers
0
You can use AJAX to load content from your index2.html
for more info w3schools

Premjith
- 1,128
- 1
- 11
- 21
-
While the browser will still show www.mysite.com as I want it ? or mysite.com/index.html because I don't need that. – marius Mar 13 '13 at 12:38
-
i mean try to load whatever content in your index2.html to index.html through AJAX request. – Premjith Mar 13 '13 at 12:53
-
Actually I need to add one link in my site that will load www.mysite.com/index2.html but I dont want index2.html to be shown in browser url. – marius Mar 13 '13 at 13:11
-
Isn't easier to add some rule in .htaccess like when people acces mysite.com/index2.html to show mysite.com alone but with index2.html content? – marius Mar 13 '13 at 13:22
-
Have a look at [this question](http://stackoverflow.com/questions/9963799/ajax-jquery-load-webpage-content-into-a-div-on-page-load) for how to easily load in the content from another page into the current page. – oatsoda Mar 13 '13 at 16:19