gpt4 book ai didi

linux - 如何为所有请求添加 ~username 前缀?

转载 作者:太空宇宙 更新时间:2023-11-04 04:15:14 25 4
gpt4 key购买 nike

我正在测试使用 cPanel 将我的网站移动到新的 Linux 服务器,这需要您输入 IP 和用户名(例如 http://123.xxx.xxx.xxx/~username/)。问题是,我的所有图像/JS/CSS 链接都使用 /css/style.css/images/picture.jpg 等路径,因此所有样式、脚本或图像都无法正确显示。

如何设置 RewriteRule 为所有请求添加 ~username 前缀?

最佳答案

在移动站点之前,如果它仅使用域名和重定向,那么现在它也应该使用服务器 IP 和用户名,确保/css/style.css 或/images/picture.jpg 的权限和所有权正确。

手动添加精确路径后也要检查它,例如“http://123.xxx.xxx.xxx/~username/css/style.css” '。

关于linux - 如何为所有请求添加 ~username 前缀?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16802452/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com