CSS or .htaccess

Forgive me if this is the wrong place to ask, but I’m wondering how I would ensure my 404 page is formatted the same for every directory. I thought I could figure this out, but I cannot.

My problem is when I test my 404 page and go to mydomain.com/pagethatdoesnotexist the 404 page looks how I want. But, if I go to any subdirectory (mydomain.com/articles/pagethatdoesnotexist), the footer text is a different font and smaller size.

I thought it would be fixable via either CSS or .htaccess, but there’s no css file in the root, and there are various .htaccess files all over in subdirectories for wordpress installs and other stuff. Yes, I’ve got quite a mess here. :slight_smile:

Is there anything I can put in one (or all) .htaccess file(s) that would ensure my 404 page looks like it does from the root directory, AND not mess with any other necessary settings in those .htaccess files?

I appreciate your thoughts in advance.


Depending on your host you can design your 404’s (I know bluehost makes this easy)

I don’t know how 404’s work (how the host generates the page for them, like, …I don’t know how to explain)

If some other user has better knoweldge of 404 then they can come here…but I’d imagine just using an absolute reference to the stylesheet would provide the smae styling (assuming the HTML is the same)

Spot on :tup:

As for the 404 HTML pages, you’d need to look at the .htaccess ErrorDocument lines
All .htaccess files should point to the same html file for the 404 error.


ErrorDocument 404 /404.html

A quick fix would be to embed the CSS in the html in <style> tags. However, that might not always be appropriate/possible depending on how your website is set up.

Another option is using the base tag in your HTML: http://www.w3schools.com/tags/tag_base.asp