jeudi 14 avril 2016

Laravel 5.1 URL's not working in new webserver (IIS 8.5)

I'm trying to setup a test server for my laravel project. While testing I face the problem that a URL is not working on the new server but is working on the old one.

Code of working server:

$.ajax({
     url: 'http://workingwebserver/cci_tool/contract/'+ whatURL + '/'+ zoekOpdracht,             
     type: "GET",
     cache: false,
     data: zoekOpdracht,
     dataType: "json",
     success: function(response){ 
         //Do something here
     }});

Console log of code above:

GET http://workingwebserver/cci_tool/contract/searchContract/ssds?ssds&_=1460622031542 200 OK 265ms

Actual location of laravel project in the webroot:

webroot\folder1\cci_tool\

Now the same code with but slightly different on the new test server returns a 500 internal server error.

$.ajax({
     url: 'http://newtestserver/cci_tool/contract/'+ whatURL + '/'+ zoekOpdracht,
     type: "GET",
     cache: false,
     data: zoekOpdracht,
     dataType: "json",
     success: function(response){
          //Do something here
     }
});

Console log of code above:

GET http://newtestserver/cci_tool/contract/searchContract/dfdf?dfdf&_=1460624321278 500 Internal Server Error 18 Ms

Actual location of laravel project in the webroot:

webroot\different_folder_name_than_working_webserver\cci_tool

I checked the URL rewrites in the cci_tool folder and those are the same. Notice that the URL is not pointing to the actual location but is skipping a folder from the actual location.

Any ideas on what's going wrong? I just copy - paste the folder from the working server to the test server. Also, as a bonus question, how can I write URL's in laravel so it won't be location or server dependend?

EDIT

I requested the page from the server to see what the 500 internal server error is actually saying. It displays a 500.19 error and says config error: Cannot read configuration file. Also the requested URL is correct but the pyshical path is pointing to:

webroot\folder1\cci_tool\

This is the physical path to the project on the other server. I need this to be

webroot\different_folder_name_than_working_webserver\cci_tool

Where can I change this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire