Help - Search - Members - Calendar
Full Version: Problem With Dynamic Archiving
Movable Type Community Forum > Using Movable Type > Entries and Archives
medic119
Ok, I am trying out MT for the first time since the Great Exodus of 3.0. In fact, I was surprised my account was still here after 4 years... smile.gif

Anyway, I set up a blog, and turned on the option to Publish Only Archive Templates Dynamically. I also have Enable Caching and Conditional Retrieval checked.
I have rebuilt ALL files several times, but no archives are ever created. I get the archives index page, but clicking a permalink/archive link gets me a 404 page. I searched the Knowledge Base and tried changing the Publish archives outside of Site Root option and adding an Archive URL and Archive Root. No good, same issue.
It is still generating links that seem to reference static pages.


Where am I messing up?

This is on MT 4.12
OtherNiceMan
It sounds as if mtview.php has not been generated or assigned as your 404 error handler. This is probably a permission issue that is preventing you from creating / modifying .htaccess

What happens with dynamic publishing is the page can not be found, mt-view as the 404 handler then finds the page and displays it.
medic119
I noticed I couldn't find mtview.cgi.

So how do I create this file and where is it supposed to go?
OtherNiceMan
It is mtview.php and it should be created after you change your publishing options and rebuild your site.
medic119
ok, I found the file, and it all seems to point to the correct paths. The ffp_local directory where it resides is chmod 777, and the /mt directories all have the permissions they had when I un-tarred the files, or permissions set as the install directions said.

However, as you can see the site still generates links as if it were a static site: http://elmo/ffp_local/archives/2008/07/test-entry.php

Is there some kind of template thing I need to change to point to mtview somehow?

CODE
<?php

    include('/srv/www/cgi-bin/mt/php/mt.php');
    $mt = new MT(3, '/srv/www/cgi-bin/mt/mt-config.cgi');
    $mt->caching = true;
    $mt->conditional = true;
    $mt->view();


?>
OtherNiceMan
do you have an .htaccess file in your directory, if so what is the content.

Also the link you posted points to an entry, which from what I read you are still publishing statically, do you have php set as the extension?
medic119
QUOTE (OtherNiceMan @ Jul 27 2008, 11:13 AM) *
do you have an .htaccess file in your directory, if so what is the content.

Also the link you posted points to an entry, which from what I read you are still publishing statically, do you have php set as the extension?


Yea, the links in the template seem to point to static entries and when you click them you get a 404 because they don't exist. It should be redirected through mtview from what I gathered, but I don't think its getting that far. Do I need to adjust a setting or template somehow to force it to point to mtview?

I checked my Apache 2 configs and it tells me I have mod_rewrite on and that everything is kosher.
Also if I type in http://elmo/ffp_local/mtview.php I get what I can assume is an MT specific 404 page as its using my MT style and site name to tell me "Page not found - /ffp_local/mtview.php" instead of the default apache 2 404.

Here is the .htaccess file in /srv/www/htdocs/ffp_local. Its the default generated MT one as this is a local install for testing and I don't need lots of customization.
CODE
## %%%%%%% Movable Type generated this part; don't remove this line! %%%%%%%
# Disable fancy indexes, so mtview.php gets a chance...
Options -Indexes +SymLinksIfOwnerMatch
  <IfModule mod_rewrite.c>
  # The mod_rewrite solution is the preferred way to invoke
  # dynamic pages, because of its flexibility.

  # Add mtview.php to the list of DirectoryIndex options, listing it last,
  # so it is invoked only if the common choices aren't present...
  <IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.htm default.htm default.html default.asp /ffp_local/mtview.php
  </IfModule>

  RewriteEngine on

  # don't serve mtview.php if the request is for a real directory
  # (allows the DirectoryIndex lookup to function)
  RewriteCond %{REQUEST_FILENAME} !-d

  # don't serve mtview.php if the request is for a real file
  # (allows the actual file to be served)
  RewriteCond %{REQUEST_FILENAME} !-f
  # anything else is handed to mtview.php for resolution
  RewriteRule ^(.*)$ /ffp_local/mtview.php [L,QSA]
</IfModule>

<IfModule !mod_rewrite.c>
  # if mod_rewrite is unavailable, we forward any missing page
  # or unresolved directory index requests to mtview
  # if mtview.php can resolve the request, it returns a 200
  # result code which prevents any 4xx error code from going
  # to the server's access logs. However, an error will be
  # reported in the error log file. If this is your only choice,
  # and you want to suppress these messages, adding a "LogLevel crit"
  # directive within your VirtualHost or root configuration for
  # Apache will turn them off.
  ErrorDocument 404 /ffp_local/mtview.php
  ErrorDocument 403 /ffp_local/mtview.php
</IfModule>
## ******* Movable Type generated this part; don't remove this line! *******
OtherNiceMan
Looks OK.

Last thing I can think of is check that the blog id is correct in your database. mt-view is linked to which ever blog has an id of 3 in the database. I think the table is mt_blog.
medic119
blog_id is 3 and I went ahead and move to MT 4.2rc4 to see if that could help me figure this out. It shows "FFP Local (3)" and it added and archives directory with another mtview.php and .htaccess in it same as in the root ffp_local dir.

Also, I got with a friend of mine running 4.12 and he said he couldn't get dynamic archiving to work either and ended up going back to static. That won't do for me cause it eats up too much diskspace.
imabug
The other thing to check for is if .htaccess overrides for your blog directory are allowed by the Apache config

If a Directory block specifying your blog directory or a directory above your blog contains an AllowOverride None, Apache will ignore the .htaccess file. One key symptom of this is that when you access what's supposed to be a dynamically generated archive file, you end up getting the system 404 error instead of the 404 generated by MT.
medic119
QUOTE (imabug @ Jul 27 2008, 04:35 PM) *
The other thing to check for is if .htaccess overrides for your blog directory are allowed by the Apache config

If a Directory block specifying your blog directory or a directory above your blog contains an AllowOverride None, Apache will ignore the .htaccess file. One key symptom of this is that when you access what's supposed to be a dynamically generated archive file, you end up getting the system 404 error instead of the 404 generated by MT.


Bingo! That was it. In of all places my httpd.conf file was set to block overrides by default on the filesystem.

All fixed.

Thank you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.