November 27, 20169 yr Hi everyone,As the title suggest my custom 404 page only works when the page has one forward slash, otherwise it still appears but there is no css or images, not sure why or how to fix this?I had a look around and read to make the link to the css absolute, but I still failed to get it working. Any help is appreciated thanks.
November 27, 20169 yr A link to the site would help. But I suspect the problem is the path to the CSS/images
November 27, 20169 yr Author sorry advimate.com is my website and <link href="css/theme.css" rel="stylesheet"> is the path to the stylesheet and images are just <img src="img/error_404.png"Cheers
November 27, 20169 yr As suspected, it's the path to your css (and JS). Try: <link href="../css/theme.css" rel="stylesheet">
November 27, 20169 yr Author Awesome that fixed it for 2 / thanks! Although it doesn't work with 3 or more / slashes strangely haha any ideas on how to fix it for all?Cheers.
November 27, 20169 yr Try: <link href="../../css/theme.css" rel="stylesheet"> But you shouldn't have any 404 errors. It would be much better to 301 from the missing pages to something suitable.
November 28, 20169 yr Awesome that fixed it for 2 / thanks! Although it doesn't work with 3 or more / slashes strangely haha any ideas on how to fix it for all? Cheers. Mate kick it root down /css/theme.css. Root never changes, relative will!
November 29, 20169 yr Author Thanks man but not following, it doesn't work when i just put "/css/theme.css"?
November 29, 20169 yr Thanks man but not following, it doesn't work when i just put "/css/theme.css"? That's unusual, how far down does the /css/theme.css file sit? Root down is absolute and not relative, and relative is why ../../css/theme.css works for some and not others, every ../ means up a level. Absolute is the opposite, using to website root as a path to the file, e.g. yoursite.com/css/theme.css ... the question is where is the css folder from the root? can you get to it at mysite.com/themes/css/theme.css? If so the root down would be just /themes/css/theme.css.
December 1, 20169 yr Author Ah no my bad! It worked perfectly once I put it live, it's just because it all looked a mess when i tested it offline haha. Thanks a lot!
Create an account or sign in to comment