Ooeee! What caused source to lose formatting?


D

dorayme

Was configuring a site of mine to understand an include in the
html

<? include "footer.inc"; ?>


Instead of the repeated footer div at the bottom of each page, I
got it to include the text from the one file in a folder called
"includes" in which was footer.inc, the div text.

In order to get it working I thought I had to add an .htaccess
file (as I have done elsewhere successfully) with the text:

AddType application/x-httpd-php .html

php_value include_path /home/domainName/public_html/includes

But there was already an .htaccess file on the server. So what to
do? I added my spiel above to the end of it and loaded it back
up. And yes, the footers all started working.

Fine... in a way... but something has happened to the source
view, it no longer appears formatted in the sense of line breaks,
it is all strung together as on one line.

Of course, I have my own html files that remain nicely readable.
But wondering if there is anything anyone can see in the addition
I did to the .htaccess that could cause this?

Before, the .htaccess said (and this was just there, I did not
put it there):

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.domainName.com.au
AuthUserFile /home/domainName/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/domainName/public_html/_vti_pvt/service.grp

and I added (after a couple of line breaks, is this latter
significant?):

AddType application/x-httpd-php .html

php_value include_path /home/domainName/public_html/includes


[I have seen odd things like no formatting when looking at source
view on Windows machines. But never on Mac before on my sites)
 
Ad

Advertisements

D

dorayme

dorayme said:
Was configuring a site of mine to understand an include in the
html

<? include "footer.inc"; ?>
....

But there was already an .htaccess file on the server. So what to
do? I added my spiel above to the end of it and loaded it back
up. And yes, the footers all started working.

Fine... in a way... but something has happened to the source
view, it no longer appears formatted in the sense of line breaks,
it is all strung together as on one line.


OK... anyone recommend a newsgroup where this is more on topic
please?
 
L

Leonard Blaisdell

dorayme said:
Was configuring a site of mine to understand an include in the
html

<? include "footer.inc"; ?>


Instead of the repeated footer div at the bottom of each page, I
got it to include the text from the one file in a folder called
"includes" in which was footer.inc, the div text.

In order to get it working I thought I had to add an .htaccess
file (as I have done elsewhere successfully) with the text:

AddType application/x-httpd-php .html

php_value include_path /home/domainName/public_html/includes

But there was already an .htaccess file on the server. So what to
do? I added my spiel above to the end of it and loaded it back
up. And yes, the footers all started working.

Fine... in a way... but something has happened to the source
view, it no longer appears formatted in the sense of line breaks,
it is all strung together as on one line.

Of course, I have my own html files that remain nicely readable.
But wondering if there is anything anyone can see in the addition
I did to the .htaccess that could cause this?

Before, the .htaccess said (and this was just there, I did not
put it there):

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.domainName.com.au
AuthUserFile /home/domainName/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/domainName/public_html/_vti_pvt/service.grp

and I added (after a couple of line breaks, is this latter
significant?):

AddType application/x-httpd-php .html

php_value include_path /home/domainName/public_html/includes

Here goes nothing. How did you save the file on the server? I'm just
sure the root of this has to do with Mac/PC/Unix line endings.
But then, I could be wrong.

leo
 
L

Leonard Blaisdell

dorayme said:
OK... anyone recommend a newsgroup where this is more on topic
please?

My best guess is that you saved a Mac formatted file to a PC server
without adjusting the line endings to the server format using your text
editor. That caused the start of the problem.
As I said in an earlier post, I 'could be/probably am' wrong. It's easy
enough to check.

leo
 
D

dorayme

Leonard Blaisdell said:
Here goes nothing. How did you save the file on the server? I'm just
sure the root of this has to do with Mac/PC/Unix line endings.
But then, I could be wrong.

leo

I just dragged it from the drawer in BBEdit to Cyberduck as usual.

I am completely baffled by it all at the moment! I got footers to
be included on a site. The site was small, about 20 or so page
and done more as a test (it makes not an iota of difference for
such a small site really but I have bigger fish to fry and better
get a handle on this little problem). This downside seems nothing
to effect any ordinary user but I would find it a nuisance when
away from my home files and wanting to quickly check up on some
problem in the html.

I removed the .hta access files this morning from the server and
all the footers disappeared. The View Source still showed up as
unformatted (meaning no line breaks) but this time, reloading
them from my home files got the formatting back again!
Previously, no amount of reloading these files would allow the
formatting to "stick" when loaded up and then "view source"ed
from a browser. But without the silly .access file it sticks
fine!

I feel a bit at a loss on all this stuff, never really mastered
the business of formatting, endings, unix, windows, pluto...
 
D

dorayme

Leonard Blaisdell said:
My best guess is that you saved a Mac formatted file to a PC server
without adjusting the line endings to the server format using your text
editor. That caused the start of the problem.
As I said in an earlier post, I 'could be/probably am' wrong. It's easy
enough to check.

leo

Its a unix server. See other post of mine too Leo. Thanks for the
suggestion though.
 
Ad

Advertisements

D

dorayme

dorayme said:
Was configuring a site of mine to understand an include in the
html
....

Fine... in a way... but something has happened to the source
view, it no longer appears formatted in the sense of line breaks,
it is all strung together as on one line.


Just a followup to this as I have stumbled across a rather weird
fix:

I was getting no formatting (or very little) when viewing the
..html files in view source in browsers even though the files
uploaded were formatted (and I am talking only modest line
breaks, I don't use indenting). No amount of reloading and
overwriting from the machine here to the server elsewhere fixed
the problem. When a file uploaded it lost its formatting on the
server. One can view the file that is on the server in FTP
programs by "opening in a a chosen editor on the local machine"
and doing this also showed the problem of lost formatting.

There seem to be two forms of overwriting:

(1) The normal one of grabbing the file.html from a local folder
and dragging over to the remote server window to tell the FTP
program to replace file.html with this file.

(2) Saving a changed "viewed from the server" file. In some FTP
programs one can view the contents of text files on the server in
any nominated text editor. And, what is more, change the contents
and save, the save being to the server file itself.

Now, if I replace the contents of the file as viewed according to
(2) by copy and paste from my local (formatted) files and save,
the formatting then sticks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

unnecessary .htaccess? 3
FrontPage? 12
Getting Apache error when trying to load mod_ruby 0
mod_python help! 1
Asp.net Important Topics. 0

Top