localhost is redirected to localhost/localhost

localhost is redirected to localhost/localhost

v k發表於
Number of replies: 2

Hello all,

I am trying to install Moodle (latest stable 3.5.2+) on my PC (Windows 10).
I have installed and configured: IIS (v.10), PHP (v. 7.0.9), Drivers PHP-SQL, MSSQL, SQL Server Manager 18 and other minor settings required to install and run Moodle.


So when time to start the Moodle installation itself, I type 'localhost' in browser and it redirects to 'localhost/localhost'.  And here comes 404.0 Error as not such resource found.

I don't get why redirecting happens??

If i try to navigate to 'localhost/install.php', then it is redirected to localhost/admin/localhost and gives 404.0 Error as well.

I tried using Failed Tracing Rules, but no help for me. 

-----

How to disable that redirect so that navigating to localhost will open Standard Moodle Initial Installation Page?


Thanks al for reading this!

評比平均分數: -
In reply to v k

Re: localhost is redirected to localhost/localhost

v k發表於
If I add test.php with the simple <?php phpinfo(); > to localhost ( = C\inetpub\wwwroot) and then  navigate to localhost/test.php - it works fine and phpinfo page is displayed.


So what might be the problem with:

  • navigating to localhost is redirected to localhost/localhost and caused 404
  • navigating to localhost/install.php is redirected to localhost/admin/localhost and causes 404 as well

what should I check?

In reply to v k

Re: localhost is redirected to localhost/localhost

Leon Stringer發表於
Core developers的相片 Particularly helpful Moodlers的相片

My best guess would be that you've got an existing config.php in the top level of your Moodle source code folder and this has the following line with the location you're being incorrectly redirected to:

$CFG->wwwroot = 'http://localhost/localhost';

You probably need to change this to:

$CFG->wwwroot = 'http://localhost';

File config.php is probably in C:\inetpub\wwwroot.

However, you wouldn't normally have an existing config.php (the file containing key configuration information about your site) before you've installed Moodle unless you've either manually created this or have already tried to install Moodle unsuccessfully.