Help - Search - Members - Calendar
Full Version: Dynamic and mtview.php Tweaks
Movable Type Community Forum > Using Movable Type > Templates and Tags
orty
(This may not be the best place to put this, but this post said this is the forum for dynamic stuff, so I'll post it here).

I've got dynamic publishing setup, running, rocking, and rolling in MT 3.121. It's creating my category and date-based archives (as well as some infrequently hit index archives).

Two things I'd like to see if I could. First off, here's my .htaccess file:

CODE
Options -Indexes
DirectoryIndex index.php index.html index.htm default.htm default.html default.asp /mtview.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /mtview.php [L,QSA]

ErrorDocument 404 /404.shtml

Redirect Permanent /blog/index.xml http://utterlyboring.com/index.rss2
Redirect Permanent /blog/index.rdf http://utterlyboring.com/index.rss2
Redirect Permanent /blog/ http://utterlyboring.com/


I removed the cruft from the .htaccess following Neil's recommendation. The redirect at the end is for my old blog location in the "/blog" directory.

Two things:

1) Because of the dynamic publishing info at the top. mtview.php is handling the 404 requests, which gives me a generic 404 page. I like being creative with my 404 pages (as you can see here and here). Is there any way to have 404 run through my normal 404 page? If I were run run my error document declaration above the MT directives, would that screw anything up, or would the MT directives take priority?

2) Many moons ago, when I restructured my archives to make more useful URLs, I created an .htaccess dump using tutorial here (linking to the Web archive because the site doesn't appear to exist anymore). So I had nearly 1300 entries in my .htaccess file that looked like this:
CODE
Redirect Permanent /blog/archives/000704.php  http://utterlyboring.com/archives/2003/06/13/one_weekend_a_month_my_ass.php
Needless to say, that wasn't the ideal solution for it, but I kept it in place at least long enough for Google to make the changes in its database. Since I don't realy want to go back into my old entries where I linked to other entries, is there a way to use mtview.php (or some other php script?) to process these missing ones? The previous filenames, as you can see, are the post's database ID with a php or html extension, plus the leading zeroes (the MT 2.x default). I thought about putting the <$MTLink entry_id="000704"$> in a mass search and replace operation into the entries, but the tag wasn't getting rendered in the entries. Is there any way to get it rendered or is there any other way to pull this off in PHP or with Apache redirects? I know there's somebody here that knows far more about Apache and PHP (Brad comes to mind, because he's a stud, and that's all there is to it biggrin.gif ) that might have a better idea on how to pull this off.

Thanks again!
orty
Anybody? I know this is probably out of the relm of a great deal of people that are on these boards, but somebody has to know smile.gif
arvind
Quite right mview.php handles the error messages. You can customize what is shown for each error message (404, 403 etc) See this tutorial for more information
orty
QUOTE (arvind_2100 @ Oct 28 2004, 05:34 AM)
Quite right mview.php handles the error messages. You can customize what is shown for each error message (404, 403 etc) See this tutorial for more information

Perfect. That kills my number 1 problem -- anybody have any ideas on the #2? (adding Movalog to my RSS readers -- thanks arvind!
arvind
The re-directs should cause no problem
orty
QUOTE (arvind_2100 @ Nov 1 2004, 01:59 AM)
The re-directs should cause no problem

I'm not worried about causing a problem, but am wondering if there's a more elegant way of doing it so I don't have 1000+ extra lines in my .htaccess file.
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-2010 Invision Power Services, Inc.