English 中文(简体)
Vue router and Vite Base url conflict
原标题:

I use Vue Router to develop my single page application and use Vite to package my project. I want to deploy all static files (such as index.js and index.css) under another CDN domain name cdn.example.com, so I used Vite Base command to build the code.

vite build --base http://cdn.example.com/

The main site of my website is http://example.com, when I visit it, the static files will automatically access cdn.example.com, and the website can be opened normally. But the route of the website has become http://example.com/http://cdn.example.com/, and the route of Vue router is also invalid (that is, when I visit http://example.com/about, it displays a 404). This confuses me, how should I fix this?

问题回答

暂无回答




相关问题
Scripts/Stylesheets: Consolidate locally or use CDN?

I can obviously do some limited testing of my own, but I m hoping to hear from some people with real-world experience on at least medium-scale web sites. Two of the items on every "top 10" list for ...

What Grid Setup would you recommend

I have a web that currently runs off one Mediatemple VPS. I m now at the stage were the site is getting bogged down with scaling issues and I need to move to a better setup. Is this a sensible ...

How does a URL qualify to be called a CDN

I would like to build my own Content Distrobution Network and I have come across a blog post showing how to do it with one of Google s services. But I can t understand it. Here s a few more questions. ...

Using a CDN like Amazon S3 to control access to media

I want to use Amazon S3/CloudFront to store flash files. These files must be private as they will be accessed by members. This will be done by storing each file with a link to Amazon using a mysql ...

Convert local (JQuery) link to CDN link at deploy time

I am currently developing an ASP.NET web application and do most of my development on the road, i.e. offline. I plan to use Google/Microsoft/an-other CDN for JQuery and a couple of other script ...

java plugin cache and dynamic IP host

I m trying to use Amazon S3 and Amazon Cloudfront CDN to deliver the jar files of my applet application. I m seeing several cache misses of my jars by the java plugin. This is a show-stopper for me, ...

热门标签