Currently working on a Vue 3 app which deployed using Azure web apps. When I deployed it to the root and used web.config it worked fine, But I need to add a Base URL. For that, I have added the following for the vite.config:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue
export default defineConfig({
plugins:[vue()],
base: 'sub-url'
})
But this failed to rewrite.
web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Handle History Mode and custom 404/500" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/sub-url/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Currently I'm using Hash Mode as a workaround but I need to use HTML version. The app works in Hash mode and locally without any errors.
