image 404 issue

This commit is contained in:
sandhiya-hepl
2026-07-20 11:44:50 +05:30
parent 8f163d4933
commit 728139b69a
14 changed files with 55 additions and 25 deletions
+10 -1
View File
@@ -1,7 +1,16 @@
Options -MultiViews Options -MultiViews
RewriteEngine On RewriteEngine On
# SPA fallback — serve index.html for non-file requests under /citpl_website # Never cache HTML entry points - otherwise browsers keep old JS that
# requests /assets/* at domain root instead of /citpl_website/assets/*
<IfModule mod_headers.c>
<FilesMatch "\.(html)$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
</FilesMatch>
</IfModule>
# SPA fallback - serve index.html for non-file requests under /citpl_website
RewriteBase /citpl_website/ RewriteBase /citpl_website/
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
+2 -2
View File
@@ -4,8 +4,8 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CITPL Admin</title> <title>CITPL Admin</title>
<script type="module" crossorigin src="/citpl_website/assets/admin-D28kGkNT.js"></script> <script type="module" crossorigin src="/citpl_website/assets/admin-CSMXWGox.js"></script>
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-DnG5sti3.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/x-BGySr-Oa.js">
<link rel="stylesheet" crossorigin href="/citpl_website/assets/admin-yhMCgkf-.css"> <link rel="stylesheet" crossorigin href="/citpl_website/assets/admin-yhMCgkf-.css">
</head> </head>
<body> <body>
+1
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{c as e,l as t,m as n,u as r}from"./x-DnG5sti3.js";import{r as i,t as a}from"./App-EUHghoux.js";var o=n(r(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})})); import{c as e,l as t,m as n,u as r}from"./x-BGySr-Oa.js";import{r as i,t as a}from"./App-CIj2WERS.js";var o=n(r(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
@@ -1 +1 @@
import{c as e,l as t,m as n,u as r}from"./x-DnG5sti3.js";import{n as i,r as a,t as o}from"./App-EUHghoux.js";var s=n(r(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})})); import{c as e,l as t,m as n,u as r}from"./x-BGySr-Oa.js";import{n as i,r as a,t as o}from"./App-CIj2WERS.js";var s=n(r(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -5,9 +5,9 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cavin Infotech | One Trusted Technology Partner</title> <title>Cavin Infotech | One Trusted Technology Partner</title>
<script type="module" crossorigin src="/citpl_website/assets/main-DS8JYUzR.js"></script> <script type="module" crossorigin src="/citpl_website/assets/main-q0-I-ADG.js"></script>
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-DnG5sti3.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/x-BGySr-Oa.js">
<link rel="modulepreload" crossorigin href="/citpl_website/assets/App-EUHghoux.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/App-CIj2WERS.js">
<link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css"> <link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css">
</head> </head>
<body> <body>
+3 -3
View File
@@ -4,9 +4,9 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CITPL Preview</title> <title>CITPL Preview</title>
<script type="module" crossorigin src="/citpl_website/assets/preview-G0j3SNu_.js"></script> <script type="module" crossorigin src="/citpl_website/assets/preview-BQQhaIEe.js"></script>
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-DnG5sti3.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/x-BGySr-Oa.js">
<link rel="modulepreload" crossorigin href="/citpl_website/assets/App-EUHghoux.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/App-CIj2WERS.js">
<link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css"> <link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css">
<link rel="stylesheet" crossorigin href="/citpl_website/assets/preview-DknkzKsF.css"> <link rel="stylesheet" crossorigin href="/citpl_website/assets/preview-DknkzKsF.css">
</head> </head>
+10 -1
View File
@@ -1,7 +1,16 @@
Options -MultiViews Options -MultiViews
RewriteEngine On RewriteEngine On
# SPA fallback — serve index.html for non-file requests under /citpl_website # Never cache HTML entry points - otherwise browsers keep old JS that
# requests /assets/* at domain root instead of /citpl_website/assets/*
<IfModule mod_headers.c>
<FilesMatch "\.(html)$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
</FilesMatch>
</IfModule>
# SPA fallback - serve index.html for non-file requests under /citpl_website
RewriteBase /citpl_website/ RewriteBase /citpl_website/
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
+1 -1
View File
@@ -12,7 +12,7 @@
{ "label": "Contact Us", "href": "#contactus", "type": "hash" } { "label": "Contact Us", "href": "#contactus", "type": "hash" }
], ],
"hero": { "hero": {
"video": "/assets/Citpl Hero Dubai(1).mp4", "video": "/assets/citpl-hero-dubai.mp4",
"badge": "Chennai & Dubai • Trusted by 100+ Clients", "badge": "Chennai & Dubai • Trusted by 100+ Clients",
"headline": "Infinite Possibilities", "headline": "Infinite Possibilities",
"subheadline": "One Trusted Technology Partner" "subheadline": "One Trusted Technology Partner"
+1 -1
View File
@@ -728,7 +728,7 @@ export default function App({ previewMode = false }) {
pointerEvents: 'none' pointerEvents: 'none'
}} }}
> >
<source src={`${assetUrl(hero.video)}?v=2`} type="video/mp4" /> <source src={assetUrl(hero.video)} type="video/mp4" />
Your browser does not support the video tag. Your browser does not support the video tag.
</video> </video>
+20 -8
View File
@@ -1,9 +1,21 @@
/** /**
* Vite base, e.g. "/citpl_website/" in production and "/" in local dev. * Vite base, e.g. "/citpl_website/" in production and "/" in local dev.
* Runtime fallback: if an old/dev build baked base "/" but the page is
* actually served under /citpl_website/, prefer the live path prefix.
*/ */
export const ASSET_BASE = (import.meta.env.BASE_URL || '/').endsWith('/') function resolveAssetBase() {
? (import.meta.env.BASE_URL || '/') const fromEnv = import.meta.env.BASE_URL || '/';
: `${import.meta.env.BASE_URL || ''}/`; let base = fromEnv.endsWith('/') ? fromEnv : `${fromEnv}/`;
if (typeof window !== 'undefined' && base === '/') {
const match = window.location.pathname.match(/^(\/citpl_website)(?=\/|$)/);
if (match) base = `${match[1]}/`;
}
return base;
}
export const ASSET_BASE = resolveAssetBase();
/** /**
* Resolve content/seed asset paths for subdirectory deploys. * Resolve content/seed asset paths for subdirectory deploys.
@@ -14,13 +26,15 @@ export function assetUrl(path) {
if (/^(data:|blob:)/i.test(path)) return path; if (/^(data:|blob:)/i.test(path)) return path;
const assetBase = resolveAssetBase();
const prefix = assetBase.replace(/\/$/, '');
// Absolute URL wrongly pointing at domain-root /assets or /uploads // Absolute URL wrongly pointing at domain-root /assets or /uploads
if (/^https?:\/\//i.test(path)) { if (/^https?:\/\//i.test(path)) {
try { try {
const u = new URL(path); const u = new URL(path);
if (u.pathname.startsWith('/assets/') || u.pathname.startsWith('/uploads/')) { if (u.pathname.startsWith('/assets/') || u.pathname.startsWith('/uploads/')) {
const prefix = ASSET_BASE.replace(/\/$/, ''); if (prefix && !u.pathname.startsWith(`${prefix}/`)) {
if (!u.pathname.startsWith(`${prefix}/`)) {
u.pathname = `${prefix}${u.pathname}`; u.pathname = `${prefix}${u.pathname}`;
return u.href; return u.href;
} }
@@ -31,8 +45,6 @@ export function assetUrl(path) {
} }
} }
const prefix = ASSET_BASE.replace(/\/$/, '');
// Already under the site base // Already under the site base
if (prefix && (path === prefix || path.startsWith(`${prefix}/`))) { if (prefix && (path === prefix || path.startsWith(`${prefix}/`))) {
return path; return path;
@@ -43,7 +55,7 @@ export function assetUrl(path) {
} }
if (path.startsWith('assets/') || path.startsWith('uploads/')) { if (path.startsWith('assets/') || path.startsWith('uploads/')) {
return `${ASSET_BASE}${path}`; return `${assetBase}${path}`;
} }
return path; return path;