Copy link to clipboard
Copied
Hello,
Does anyone know of a way to apply a site-wide redirect? For maintenance, purposes is what I'm going for. That way if a user accesses the site from a search term or bookmark, to www.site.com/directory/somepage.html, it can be auto-forwarded to /maintenance.html? I know about the individual page redierects, but if a site is content heavy, I don't want to redirect 400 pages individually and then have to undo it all again. I've done this with .htaccess files but, to my knowledge, we can't access BC .htaccess.
Thoughts or ideas?
Copy link to clipboard
Copied
BC can't do it, but Javascript can.
You can check document.location.pathname for a match (e.g., starts with '/directory/'), then replace it. Some info here: url - jQuery if Location.Pathname contains - Stack Overflow
Chuck the code in a content holder, then insert that content holder in the relevant templates.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more