I would like to have a URL be redirected to a different page on the same domain but without the browser changing the URL. So the page www.mydomain.co.za should point towards www.mydomain.co.za/index.html. I have tried the solutions to similar questions on Stackoverflow, but still cannot get it to work.
Asked
Active
Viewed 580 times
0
-
possible duplicate of https://stackoverflow.com/questions/1911417/htaccess-rule-to-redirect-domain-to-index-html – Ravinder Reddy Oct 27 '17 at 19:25
-
Possible duplicate of [Htaccess rule to redirect domain to index.html](https://stackoverflow.com/questions/1911417/htaccess-rule-to-redirect-domain-to-index-html) – Jayakrishnan Oct 27 '17 at 19:27
-
Thanks for the answers. Everything is working now as it should. – Johann Hanekom Oct 31 '17 at 12:24
2 Answers
0
in case you didn't know, if you create an index.php or index.html page, you don't really need to write momomo.com/index.php because if you write momomo.com your webserver automatically redirects you to the index page which is the main page of almost every site

Orange Orange
- 1,763
- 1
- 10
- 18
0
first of all, you don't need to write index.html/index.php at the end of url, the server will automatically will open them.
but for redirecting problem, you can not redirect without changing url but you have some options:
1) use php include and include the file that you are trying to open, in your index.php file
2) use ajax to load and get the page that you are trying to open and put it in the body (or any other tag you wish)

Godfather
- 342
- 4
- 18