apache - 使用 expo build:web 反应应用程序构建文件夹在主域的子目录中覆盖网址中的子 URL
问题描述
我把“主页”:“https://example.in/reactapplication/”放在 package.json 文件中。我使用 expo build:web 构建了应用程序,并将 web-build 文件夹的内容放在主域的子目录中。
一切运行良好意味着登录页面在我输入 https://example.in/reactapplication时显示,但它通过 URL https://example.in/reactapplication/重定向到https://example.in/Login但我期望它显示https://example.in/reactapplication/Login。
同样在刷新页面时,它显示页面未找到。任何人都可以指出我的原因吗?
这是我的 App.json 文件
const prefix = Linking.makeUrl('/');
const linking = {
prefixes: [prefix],
};
export default function App(){
return(
<NavigationContainer linking={linking} fallback={<Text>Loading...</Text>}>
<Stack.Navigator
initialRouteName='Login'
>
<Stack.Screen
name="Login"
component={Platform.OS==='web'?LoginWeb:LoginAndroid}
options={{ title:null,headerShown:false}}
/>
<Stack.Screen
name="ForgotPassword"
component={Platform.OS==='web'?ForgotPasswordWeb:ForgotPasswordAndroid}
options={{ title:null,headerShown:false}}
/>
</Stack.Navigator>
</NavigationContainer>
)
}
.htaccess 代码是
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /reactapplication/
</IfModule
解决方案
推荐阅读
- shake-build-system - 如何使用额外的命令行参数扩展 Shake?
- sql - SQL:如何将有序行分组;基于分组中断行拆分
- elasticsearch - 在匹配查询中使用 OR
- javascript - 如何阻止用户在 Oracle APEX builder 中关闭窗口
- google-bigquery - 以编程方式检查上次通过查询访问表的时间?
- excel - 无法通过在 Excel 中保存副本将 .xlsx 文件保存为共享点列表中的 PDF。
- android - 只有当两个开关按钮被独立检查/激活时才做某事
- r - 删除重复的行但忽略变量名
- c++ - 在 Visual C++ CLR 项目中编译 .hpp 文件
- css - 如何使用css在左上角和左下角创建带有曲线的矩形?