Rails有没有办法将所有子域重新路由到www?例如,如果有人输入https://blah.example.com/campaign/39/public,则会转到https://www.example.com/campaign/39/public
blah可以更改为https://google.example.com/campaign/41/public之类的内容,但它会始终路由到www https://www.example.com/campaign/41/public
答案 0 :(得分:0)
是的,可以将任何域名链接重定向到www。
您需要更改return;
文件,如下所示:对于Apache2和httpd
json_string=responseOutput.toString();
JSONArray jsonArray = new JSONArray(json_string);
int count =0;
count= jsonArray.length();
JSONObject jobj = jsonArray.getJSONObject(0);
String LabLocation = jobj.getString("LabLocation");
String RackLocation = jobj.getString("RackLocation");
String ShelfLocation = jobj.getString("ShelfLocation");
String fourBid = jobj.getString("fourBid");
String Cluster = jobj.getString("Cluster");
String fourBookingName = jobj.getString("fourBookingName");
String SoftwareVersion = jobj.getString("SoftwareVersion");
String HardwareType = jobj.getString("HardwareType");
String AssetNo = jobj.getString("AssetNo");
String SerialNO = jobj.getString("SerialNO");
String Location = jobj.getString("Location");
return " "+"LabLocation" + ":" +" " +LabLocation + "\n" + " "+"RackLocation" + ":" +" " +RackLocation
+ "\n" + " "+"ShelfLocation" + ":" +" " +ShelfLocation + "\n" + " "+"4BookingID" + ":" +" " +fourBid
+ "\n" + " "+"Cluster" + ":" +" " +Cluster + "\n" + " "+"4BookingName" + ":" +" " +fourBookingName
+ "\n" + " "+"SoftwareVersion" + ":" +" " +SoftwareVersion + "\n" + " "+"HardwareType" + ":" +" " +HardwareType
+ "\n" + " "+"AssetNo" + ":" +" " +AssetNo + "\n" + " "+"SerialNO" + ":" +" " +SerialNO + "\n" + " "+"Location" + ":" +" " +Location;
}
如果你使用nginx而不是使用这个
conf
希望它会帮助你..