Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mode_rewrite; almost there!

Status
Not open for further replies.

cabernet

Technical User
Feb 24, 2003
75
0
0
PK
Hello,
Is it possible applying mode_rewrite to the content of a folder located at root level
That contains PHP files and has an index.php
But knowing that the site root index is index.html
This mode rewrite utilizes OB and works fine with another site
However the other site root index has a PHP extension as index.php
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 (MySQL) 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);
}
?>
In this case my root index.html does not work any
longer and cannot be displayed like if the rewrite was impacting on the root index as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top