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

How are you redirecting it?

This way:

header("Location:page.php");

what error you got post your code and error type

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");
?>

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

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.

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

Yeah

Member Avatar for diafol

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?

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.