PDA

View Full Version : Update V4 (PHP) -> V5 (CGI), Mod Rewrite


Rem
04-04-2007, 11:50 AM
Hello!

I have recently updated from V4 to V5 and from PHP to cgi. There is a single problem, that I need to fix. I would like to rewrite (htaccess) the following search queries:


domain.org/search/search.php?zoom_query=keyword1+keyword2
domain.org/search/search.php?zoom_sort=0&zoom_query=keyword1+keyword2&zoom_and=1
domain.org/search/search.php?zoom_sort=0&zoom_cat=2&zoom_query=keyword1+keyword2&zoom_and=1

(Currently, it seems that these three also work with "search.gci?..."

So I would like to have these URLs still working, but the results of the cgi should be displayed. There are two questions that need to be answered:
First, is there a specific problem with non-working parameters?
Second, if there is a faster htaccess rule for this, could someone please post it:
RewriteRule ^search/search.php\?(.*)$ http://www.domain.org/search/search.cgi?$1

I need these fixes, because I have distributed search plugins for firefox with an update cycle of 1 week (and more)...

wrensoft
04-04-2007, 11:42 PM
The paramerters used by the CGI are for the most part the same as the PHP script.

As another solution, you could also just wrap the CGI in PHP and avoid doing the re-write. For example in PHP on Apache,

<?php
$QSTRING = $_SERVER['QUERY_STRING'];
virtual("/cgi-bin/search.cgi".'?'.$QSTRING);
?>

Otherwise I am not an expert on Apache MOD_REWRITE effencicy and you might be better off posting the question in an Apache developers forum.

Rem
04-05-2007, 01:12 AM
I have to thank you for the idea with PHP!

I will check the options!