Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
Converting .shtml pages to .php

 

 


catweasel
User

Feb 15, 2009, 4:05 AM

Post #1 of 19 (10045 views)
Shortcut
Converting .shtml pages to .php Can't Post

Hi guys,

I have been running AM2 using .shtml file extensions. I would like to be able to publish RSS Feeds from other web sites on my Index page, but this requires using 'php includes'.

My problem is that my Server will not execute .php files on .shtml pages. I have tried a number of suggestions, but to nothing seems to work.

So this is my idea... change all .shtml include references in my Templates to .php, then re-publish my site in AM2 changing the 'Default File Extension' setting from .shtml to .php

I would then update my .htaccess file using 'mod_rewrite' to redirect Search Engines etc to the new files.

My question is, would this work OK without causing too many problems? Is there anything else I need to do in order to make this a smooth transition?

Thanks,
Ray


Karsten
Novice

Feb 16, 2009, 10:44 AM

Post #2 of 19 (10017 views)
Shortcut
Re: [catweasel] Converting .shtml pages to .php [In reply to] Can't Post

I would be interested in knowing how to do this as well.

From what I could find on the internet, there appears to be a htacess solution to the problem.

See e.g. http://www.webmasterworld.com/apache/3739330.htm

Can you please confirm this and in what directory should the htaccess file be stored? (either when using the flat file system or the mysql system to store files)


Donna
Staff / Moderator


Feb 17, 2009, 2:07 PM

Post #3 of 19 (10003 views)
Shortcut
Re: [catweasel] Converting .shtml pages to .php [In reply to] Can't Post

Hi there,

Yep, you can definitely use PHP instead -- the one thing specific to Article Manager you'll want to make sure of is that you've changed all of the Server Side Includes to PHP includes. You'll want to go through all of your templates and replace any SSI with a PHP include.

Otherwise, it should work just fine. :)

Donna

--
support@interactivetools.com


Donna
Staff / Moderator


Feb 17, 2009, 2:08 PM

Post #4 of 19 (10002 views)
Shortcut
Re: [Karsten] Converting .shtml pages to .php [In reply to] Can't Post

Karsten: .htaccess files generally go in the document root, and you can then tell them which directories the instructions should apply to.

Donna

--
support@interactivetools.com


Karsten
Novice

Feb 17, 2009, 2:56 PM

Post #5 of 19 (9999 views)
Shortcut
Re: [Donna] Converting .shtml pages to .php [In reply to] Can't Post


In Reply To
Hi there,

Yep, you can definitely use PHP instead -- the one thing specific to Article Manager you'll want to make sure of is that you've changed all of the Server Side Includes to PHP includes. You'll want to go through all of your templates and replace any SSI with a PHP include.

Otherwise, it should work just fine. :)


Donna, thank's a lot.

One question: following the procedures in the admin panel, the shtml files are changed to php's, while the template files remain html's. Do the template files also need to be converted to php files?


catweasel
User

Feb 18, 2009, 1:55 PM

Post #6 of 19 (9974 views)
Shortcut
Re: [Donna] Converting .shtml pages to .php [In reply to] Can't Post

Hi Donna,

Thanks for the reply.

OK... I changed all the templates/template includes etc from .shtml to .php, and re-published after changing the 'Default File Extension' setting from .shtml to .php

So far, so good. All the articles appear on the Index page as they should.

However (isn't there always an 'however'!) I have two problems...

1. When I click on an article, I get the following error :

Internal Server Error :
File "/home/site/public_html/news/magazines-for-sale.php" is writeable by others

2. All hypens and quotation marks appear as ’ rather than '.
( All Templates contain :
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> )

I have resorted back to .shtml files again for now, and everything is working fine.

Any suggestions on how I can get around these errors?

Thanks,
Ray


Donna
Staff / Moderator


Feb 18, 2009, 4:20 PM

Post #7 of 19 (9971 views)
Shortcut
Re: [Karsten] Converting .shtml pages to .php [In reply to] Can't Post

Hi Karsten -- nope, the templates will stay the same. They're never actually executed on the server, only used by Article Manager. :)

Donna

--
support@interactivetools.com


catweasel
User

Feb 19, 2009, 1:50 AM

Post #8 of 19 (9941 views)
Shortcut
Re: [catweasel] Converting .shtml pages to .php [In reply to] Can't Post

Hi,

An update to my previous post... For some reason, the files being re-published had permissions of 666. I changed all these to 755 and it all works OK. Phew! Smile Smile

My only issue now is with the punctuation/symbols not displaying correctly.

Any suggestions?

Thanks.


Donna
Staff / Moderator


Feb 20, 2009, 2:53 PM

Post #9 of 19 (9890 views)
Shortcut
Re: [catweasel] Converting .shtml pages to .php [In reply to] Can't Post

Hi Ray,

Can you send me a link to a page that has the odd characters showing?

Donna

--
support@interactivetools.com


aussieincanada
User

Feb 21, 2009, 11:32 AM

Post #10 of 19 (9865 views)
Shortcut
Re: [Donna] Converting .shtml pages to .php [In reply to] Can't Post

<!--#include virtual="/dir/whatever.php" --> includes a php file on a shtml extension page for me.


Donna
Staff / Moderator


Feb 24, 2009, 1:09 PM

Post #11 of 19 (9718 views)
Shortcut
Re: [aussieincanada] Converting .shtml pages to .php [In reply to] Can't Post

Hi there,

Sorry, I meant an actual link to the page in question on your site -- I'd like to take a look at it directly so I can see the odd characters myself.

If you'd rather not post this on the forums, feel free to fill in a support request here:

https://www.interactivetools.com/support/email_support.cgi

I hope this helps. :)

Donna

--
support@interactivetools.com


catweasel
User

Apr 10, 2009, 5:44 AM

Post #12 of 19 (8820 views)
Shortcut
Re: [Donna] Converting .shtml pages to .php [In reply to] Can't Post

Hi Donna,

Sorry for the delay in replying. I think I have sorted out the problems with strange characters appearing in the posts after converting to .php – I think it was to do with me pasting text from Rich Text docs, instead of Plain Text docs. Unimpressed

While I'm here though...

I am running my copy of AM2 on my desktop computer using MAMP, and after a few problems setting the correct Server Settings, I am now able to update my site and all AM Templates etc locally before going live again.

So far, the only thing I cannot get to work correctly are the 'Category Breadcrumbs'.

My current (.shtml) Templates are set to : <!--#include virtual="$published.categoryBreadcrumb.webpath$" -->

I have changed this to : <?php include("$published.categoryBreadcrumb.webpath$"); ?>

However, nothing shows up on the published page. I'm sure this is down to an error on my behalf, but can't quite figure it out!

Thanks,
Ray


carminejg3
User

Apr 10, 2009, 11:59 AM

Post #13 of 19 (8814 views)
Shortcut
Re: [catweasel] Converting .shtml pages to .php [In reply to] Can't Post

Also has your site been showing your files as .shtml for a while? If so you might lose any of the indexing you have.

Another way to change this (YOU WILL STILL NEED TO CHANGE THE WAY FILES GET INCLUDED TO PHP INCLUDES)

you could if you have access to the etc/httpd/http.conf file is to have php parse the files in your publish folder as php files something like this would be needed.

addtype application/x-httpd-php .shtml .php .html

searching this string will bring up some more answers. Also let me know and i will dig deeper since I'm also in the process of converting my .shtml files to run as php in the backgroud even though they will keep their .shtml extension.


Webmaster [wink]
http://news.carjunky.com


giles
User

May 12, 2009, 3:55 AM

Post #14 of 19 (6918 views)
Shortcut
Re: [catweasel] Converting .shtml pages to .php [In reply to] Can't Post


In Reply To
So far, the only thing I cannot get to work correctly are the 'Category Breadcrumbs'.

My current (.shtml) Templates are set to : <!--#include virtual="$published.categoryBreadcrumb.webpath$" -->

I have changed this to : <?php include("$published.categoryBreadcrumb.webpath$"); ?>


Yep I have had a similar problem with the breadcrumbs. I have everything else working fine.

Giles


Donna
Staff / Moderator


May 12, 2009, 3:24 PM

Post #15 of 19 (6909 views)
Shortcut
Re: [giles] Converting .shtml pages to .php [In reply to] Can't Post

Hi there,

Try changing "webpath" to "filepath". PHP requires the full filepath, instead of just the path from the document root. :)

Donna

--
support@interactivetools.com


giles
User

May 13, 2009, 1:17 AM

Post #16 of 19 (6896 views)
Shortcut
Re: [Donna] Converting .shtml pages to .php [In reply to] Can't Post

Thanks Donna,

I had already tried that, but your reply made me go and look at the problem again and I think I have identified the issue:

The include code I am using on the categoryIndex.html file is:

Code
<?php include 'http://www.xxxxxx.com/artman2/publish/<catFile>/include_categoryBreadcrumb.php'; ?>


However, it is actually getting the

Code
<cat>

to be read. I need to be able to call the folder on the fly and I'm not sure how to do that.

Regards
Giles


(This post was edited by giles on May 13, 2009, 1:19 AM)


Donna
Staff / Moderator


May 14, 2009, 3:58 PM

Post #17 of 19 (6869 views)
Shortcut
Re: [giles] Converting .shtml pages to .php [In reply to] Can't Post

Hi giles,

The placeholder for the category name should be $category.filename$ (although might be different depending on your setup, you can use the <!-- templatePlaceholderList --> to see all of the placeholders available in that spot.)

Alternately, you can let Article Manager figure out the path for you (recommended), and use this instead:

<?php include '$published.categoryBreadcrumb.filepath$'; ?>

Let me know if that works for you.

Donna

--
support@interactivetools.com


giles
User

May 15, 2009, 1:27 AM

Post #18 of 19 (6861 views)
Shortcut
Re: [Donna] Converting .shtml pages to .php [In reply to] Can't Post

Ahhh Now I understand. Your recommended solution was bang on Donna. Thank you so much, it was purely my misunderstanding.

Regards
Giles


catweasel
User

Aug 2, 2009, 6:42 AM

Post #19 of 19 (6056 views)
Shortcut
Re: [giles] Converting .shtml pages to .php [In reply to] Can't Post

Hi,

I know this seems to have been going on for ages, but I have now finished re-designing my AM site and successfully converted all .shtml pages into .php

So far, so good.

When I have uploaded all the files to my Server again, AM throws up an error message when it tries to access the 'search.cgi' script.

I get the following error message:
[Server Resolved SSI Error : Server returned a response code of '500' on the following request: http://www.domain.co.uk/temp_1249219897000.php ]

I have re-installed AM from scratch again, but still get the same error message. I know this may be a Server related issue, and I have put in a support request from my hosting company; I just wondered if you had any idea from the AM side of things what could cause this?

Thanks,
Ray