Hey guys, a little question.
I use PHP to delete / add static pages after deleting the page, I want to remove it from .htaccess, however I tried this, but it causes an error:
Warning : preg_replace () [function.preg-replace]: Unknown modifier '\' in ...
The code:
$page_name = $row['page_name']; // Example: help
preg_replace('/RewriteRule ' . preg_quote('^' . $page_name . '/?$ page.php?mode=') . '.*/i', '', $htaccess);
This is an example of what it should completely remove:
RewriteRule ^help/?$ page.php?mode=help
source
share