Forum Moderators: DixonJones
I gather ( but am not entirely sure), that these things occur, when the user uses the "Save as" command to save a copy of my webpage to his/her local disk, and then views the local page. Its apparently a problem that occurs because "Save as" didn't correctly rewrite the "@import" type of stylesheet syntax that is commonly used.
Now that I've cleaned up my error logs in other ways, by handling exploits in .htaccess, these off-line stylesheet requests have now become a noticable irritating cause of errors.
So I add this bit of code to my .htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# Fix off-line browser requests for my styles.css
RewriteCond %{REQUEST_URI} \_files/styles\.css$
RewriteRule .* /styles.css [L]
And that seems to be working. But I post it here, in case there are other variations on the off-line browser - stylesheet theme, where others might care to suggest improvements. (I'm still learning, eh?)
is the error happening /when/ the user saves the page or is it when they try to access the page after saving it?
TTBOMK, IE saves pages in the format stevenha wrote... page_name_files\files_in_page
i don't think that the actual css file is being changed but the html files are being "localized" for the saved copy... its possible that the @import is being missed by the browser's save function... how is that @import coded in your pages, stevenha?
# Fix off-line browser requests for my style.css
RewriteCond %{REQUEST_URI} ./stylies\.css$
RewriteRule .* /stylies.css [L]
And that seems to work for all the variations.
wkitty24 asked about the format of my @import statements. This is what I've been using.
<style type="text/css" media="all">@import "../style.css";</style>
Yes, I believe that when "Save as" tries to localize the html page ( that it is saving localling on the users hard disk), it seems to mis-interpret the "@import" part. The bad requests then seem to come when they later try to view the page they saved to their hard disk.
i noticed this type of behavior with some wysiwyg editors... i used to use dreamweaver and when linking to pages and/or images, it would offer a choice between relative to the site or relative to the page... relative to the page gave me references like your "../style.css" stuff...