Hello i have index.php file in root directory redirecting to a page.
It's working perfect on my localhost but not the webserver.
Also link to the root folder on the webserver lists files excluding the index.php
Please i need help with this

Re: index.php not showing/working in root folder 80 80

How are you redirecting it?

Re: index.php not showing/working in root folder 80 80

This way:

header("Location:page.php");
Re: index.php not showing/working in root folder 80 80

what error you got post your code and error type

Re: index.php not showing/working in root folder 80 80

the problem is when I type the url to the root folder of the website it shows a list of files in the folder and i dont want that so i placed this code in the index.php

<?php
header("Location:myMainHomepage.php");
?>
Re: index.php not showing/working in root folder 80 80

Have you tried adding a space after the colon? If that does not work either, try a fully qualified URL.

Re: index.php not showing/working in root folder 80 80

Tried both but still not working.
However it works on my localhost and even the index.php file doesn't show up in the root directory on the webserver.

Re: index.php not showing/working in root folder 80 80

Are you sure it's uploaded to the right location on your server then?

Re: index.php not showing/working in root folder 80 80

Yeah

Re: index.php not showing/working in root folder 80 80

be sure to turn on your error handling

<?php
error_reporting(E_ALL);
?>

you can also try

<?php
header("Location: http://www.yoursite.com/index.php");
?>
Re: index.php not showing/working in root folder 80 80
Member Avatar

So, you're saying that http://www.example.com/index.php (your domain of course) when entered into the browser address bar, fails to show?

Re: index.php not showing/working in root folder 80 80

So, you're saying that http://www.example.com/index.php (your domain of course) when entered into the browser address bar, fails to show?

yeah, it fails to show up.
And browser shows the error : The resource requested could not be found on this server!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.