#Characters in CSS URL cause redirect
2 messages · Page 1 of 1 (latest)
The knowledge sources do not contain enough information to directly address this specific issue about @_@astro characters in generated CSS filenames causing 307 redirects.
However, based on what the knowledge sources do cover, there are a couple of potentially relevant options:
1. Customize output filenames using Rollup options
You can override the default asset naming pattern in your astro.config.mjs to avoid problematic characters in filenames: [customizing output filenames]
import { defineConfig } from 'astro/config';
export default defineConfig({
vite: {
environments: {
client: {
build: {
rollupOptions: {
output: {
assetFileNames: 'static/[name]-[hash][extname]',
},
},
},
},
},
},
});
This would change where and how assets (including CSS) are named in the build output, potentially avoiding the @ character issue.
2. Change the assets directory
You can also change the _astro output directory name using build.assets: [build options]
{
build: {
assets: '_custom'
}
}