多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# h5单独部署域名 第一步:下载uniapp源码 ![](https://img.kancloud.cn/25/20/25206827f4a86f7fc64a82cb7d131486_1920x619.png) ![](https://img.kancloud.cn/8e/8d/8e8d8a5a74c81a4c8114c5d4d4b73d5b_1920x798.png) 第二步:下载hbuilder(\[[https://www.dcloud.io/hbuilderx.html](https://www.dcloud.io/hbuilderx.html)\]) ![](https://img.kancloud.cn/53/9d/539d756b161f9a677c3608688b592485_1920x847.png) ![](https://img.kancloud.cn/3a/bb/3abbe40e59b0b3c5755ec5c1c280894b_1920x843.png) 第三步:导入下载下的uniapp源码 ![](https://img.kancloud.cn/d3/8f/d38f6e8a6a92a2d792a6e6c9180541a3_1621x702.png) 第四步:把配置文件配置好 ![](https://img.kancloud.cn/13/e5/13e543a4807795dc70c4251a7fda3210_1271x683.png) 第五步:需要先安装一个插件scss/sass插件 ![](https://img.kancloud.cn/e6/0f/e60ffc1ff610b1df5c26abe0966de0b5_1497x906.png) 第六步:发行h5 ![](https://img.kancloud.cn/f3/a5/f3a5e828694b240c51484e3332f16dca_1205x771.png) ![](https://img.kancloud.cn/96/bc/96bcf2734371f7de41c7e9404ec23fb0_1496x701.png) ![](https://img.kancloud.cn/f1/0b/f10b0fa01a4ac66ab0952668914c446b_1327x736.png) 第七步:发行完之后 找到路径 把代码压缩上传到新建的站点根目录并解压到根目录 ![](https://img.kancloud.cn/7c/c8/7cc8ea9a85447efb4d3028d4b7af012e_1554x894.png) ![](https://img.kancloud.cn/42/22/42221568855c4be33bc67e3650b44108_881x541.png) 第八步:给该网站配置伪静态 nginx环境下伪静态配置 ![](https://img.kancloud.cn/0e/49/0e49d6990f84f102bc5dd56cb0d082dd_704x688.png) 修改成如下图 ![](https://img.kancloud.cn/c5/2b/c52b572dca16b0bffe6a499160b1fb25_728x559.png) nginx环境伪静态配置 ``` location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; } } ``` apache环境下伪静态配置 根目录下的.htaccess文件添加伪静态配置如下图 <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /index.html [L] RewriteEngine on RewriteCond % !^$ </IfModule> ![](https://img.kancloud.cn/c8/28/c828f8dd05fb370a0f4ad87e1ceefaa0_421x230.png) 第九步:后台访问手机端域名设置需要修改成你的单独配置的域名 ![](https://img.kancloud.cn/00/0c/000c42f75cf75b7b4bcc19c6dbbf0c05_1905x845.png) 第十步:如果需要在微信公众号中拿单独域名访问 请把此域名配置到微信公众号的业务域名、js域名、网页域名即可 ![](https://img.kancloud.cn/15/01/150140c9c9841ff87dc474294b73fb59_1849x789.png) 这样就单独域名配置完成了!