Javascript <;询问>;Laravel应用程序迁移到新服务器后找不到文件
我正在尝试将我的laravel应用程序迁移到新服务器 以前,我的应用程序运行在/var/www/html/demo中,在新服务器中,我将其作为根文件夹放在/var/www/html中 一切正常,但当我尝试运行某些函数时,会收到以下错误消息:Javascript <;询问>;Laravel应用程序迁移到新服务器后找不到文件,javascript,laravel,Javascript,Laravel,我正在尝试将我的laravel应用程序迁移到新服务器 以前,我的应用程序运行在/var/www/html/demo中,在新服务器中,我将其作为根文件夹放在/var/www/html中 一切正常,但当我尝试运行某些函数时,会收到以下错误消息: Failed to load resource: the server responded with a status of 404 (Not Found) natagen.js:519 1 http://mydomaincom/api/publisher
Failed to load resource: the server responded with a status of 404 (Not Found)
natagen.js:519 1
http://mydomaincom/api/publishers/7 Failed to load resource: the server responded with a status of 404 (Not Found)
在文件natagen.js
中,我有以下代码:
var apiPath = function(resource_identifier){
var baseUrl = $('.base-url').val();
var baseApi = baseUrl + '/api/';
return baseApi + resource_identifier;
};
/**
* adPath
*
* @return void
**/
var adPath = function(id){
return apiPath('../app-data/ads/'+id+'/');
};
var apiPath = function(resource_identifier){
var baseUrl = $('.base-url').val();
var baseApi = baseUrl + '/api/';
return baseApi + resource_identifier;
};
/**
* adPath
*
* @return void
**/
var adPath = function(id){
return apiPath('../public/app-data/ads/'+id+'/');
};
此外,我无法访问http://mydomaincom/api/
在迁移到新服务器之前,文件natagen.js
包含以下代码:
var apiPath = function(resource_identifier){
var baseUrl = $('.base-url').val();
var baseApi = baseUrl + '/api/';
return baseApi + resource_identifier;
};
/**
* adPath
*
* @return void
**/
var adPath = function(id){
return apiPath('../app-data/ads/'+id+'/');
};
var apiPath = function(resource_identifier){
var baseUrl = $('.base-url').val();
var baseApi = baseUrl + '/api/';
return baseApi + resource_identifier;
};
/**
* adPath
*
* @return void
**/
var adPath = function(id){
return apiPath('../public/app-data/ads/'+id+'/');
};
如果我更改url/path目录,我应该在laravel配置中更改什么路径?请尝试使用composer dump autoload命令,并检查是否有任何与htaccess相关的更改。仍然有相同的错误
加载资源失败:服务器响应状态为404(未找到) http://139.59.244.170/api/publishers/7 加载资源失败:服务器响应状态为404(未找到)