From http://localhost/ I want to access http://localhost/1.php
How can I make it so I can access the 1.php file in the browser without changing the url?
From http://localhost/ I want to access http://localhost/1.php
How can I make it so I can access the 1.php file in the browser without changing the url?
Use DirectoryIndex 1.php
in your .htaccess
file
You could use AJAX to get content of different PHP files and display that on your landing page
Here a simple example: index.html page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Ajax example</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script src="https://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$("#page1").click(function(){
$('#result').load('page1.html');
});
$("#page2").click(function(){
$('#result').load('page2.html');
});
//and so on
});
</script>
</head>
<body>
<ul>
<li><a id="page1" href="#">One</a></li>
<li><a id="page2" href="#">Two</a></li>
<li><a id="page3" href="#">Three</a></li>
</ul>
<div id="result" style="clear:both;">
</div>
</body>
</html>
Assume you have page1.html with the content
<h1>Hi this is page1</h1>
The click on link "one" will fill the div with content of page1.html and so on
Whit this type of implementation you should factory the other pages without header and meta.