Page 1 of 1

rewrite rule for CalendarZoom

Posted: Wed Dec 29, 2004 11:08 pm
by steve
We're implementing the beta shared installation 0.70 and thus far it is great.

For a host of reasons, we decided no to import entries for a few of the larger more seasoned blogs. Instead, we are going to maintain the old blog online, and link to the new version blog for '2005'.

The old blog is version 0.30.

A couple of questions:

Can anyone give some rewriterule recommendations for the calendarzoom URI's for January 2005? We've tried a few variations to no avail.

Our setup looks like:

0.30 version root http://domain.com/blog/
0.70 version root http://domain.com/blog1/

The calendar plugin configures URI's like
http://domain.com/blog/index.php?serendipity[calendarZoom=200501&serendipity[category]=3

which we are trying to rewrite to

http://www.domain.com/blog1/index.php?s ... ategory]=3

We've tried:
RewriteEngine on

RewriteRule ^blog/index\.php\?serendipity\[calendarZoom\]=200501(.*)$ http://www.domain.com/blog1/index.php?s ... ]=200501$2 [R=301,L,QSA]

in .htacess in both the domain.com root (which contains both blog and blog1) and in the blog and blog1 directories.

And of course we are going to go backwards as well, so rewrites from the blog1 directory when asking for December 2004 would be helpful too.

If there are any rewrite guru's out there, we could sure use the help.

thank you all in advance!

Posted: Thu Dec 30, 2004 1:29 am
by Riken
Try this in the .htaccess of the domain.com root:

Code: Select all

RewriteEngine on
RewriteBase /

RewriteRule ^blog/index\.php\?serendipity\[calendarZoom\]=2005(.*) blog1/index.php?serendipity[calendarZoom]=2005$1
RewriteRule ^blog1/index\.php\?serendipity\[calendarZoom\]=2004(.*) blog/index.php?serendipity[calendarZoom]=2004$1

Posted: Thu Dec 30, 2004 10:36 pm
by Guest
well no, that didn't make it. The domain.com root currently processes rewrites, and I'm wondering if there is something in the serendipity code that is previnting the rewrite?

Posted: Fri Dec 31, 2004 12:58 am
by Riken
Have you set apache to allow overrides for that directory?

Code: Select all

<Directory [path to blog/blog1]>
    AllowOverride All
    ...
</Directory>
You need to do this before the .htaccess file will work.

AllowOverrides All {set}

Posted: Fri Dec 31, 2004 3:11 am
by steve
Yes, we did :)

The domain.com root process rewrites currently, it has the AllowOveride All directive as does blog and blog1; all these are set via httpd.conf.

Thanks for the inputs.

It's strange because we also tried a

Redirect 301

and that didn't work either

closer but

Posted: Wed Jan 05, 2005 2:56 am
by Guest
RewriteBase /
RewriteCond %{QUERY_STRING} (.*)=2005(.*)
RewriteRule ^blog/(.*) http://domain.com/blog1/\1%1+2005%2 [L]
RewriteCond %{query_string} (.*)=2004(.*)
RewriteRule ^blog1/.* http://domain.com/blog/\1%1=200412%2 [L]

BUT

not quite there yet. The first rule *works* except the "blog" directory name is not correct, it should be blog1. What is puzzling to me (noob) is that the 0.70 installation shows up, even tho the uri isn't *correct* (it says domain.com/blog/***, and not domain.com/blog1/***)

Any ideas?