Forum Moderators: coopster

Message Too Old, No Replies

A rewrite tune up

is it possible?

         

henry0

8:54 pm on Mar 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That rewrite works great on other sites with an index (Home page extension of “ .PHP “ )
But I cannot figure how to make it working on a new site where the main applications are PHP but the index Home page) has a “ .HTML “ extension

The map is as follow:
From root
The index.html and a folder named display_hp with its main page named index.php, that offers a pagination without a clean URL

How could I make the rewrite working with the display_hp folder and its php index.
as is the status bar shows the correct clean address
but it results in page not found.

RewriteEngine on
RewriteRule (index.php)-([^-]+)-([^-]+)\.html$ $1.html?$2=$3 [N,QSA]
RewriteRule index\.html index.php


<? // goes on top of the PHP page
ob_start('post_process');
function post_process($buffer) {
return preg_replace("'index.php\?([^\"\']+)'e", "'index-'.implode('-', preg_split('/&¦=/', '\\1')).'.html'", $buffer);
}
?>

<edit> added comment </edit>

henry0

12:59 pm on Mar 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I forgot adding
That in this case my root index.html does not work any
longer