I am having a bit of a problem with mod_rewrite. This module is active on my apache server. My codes:
index.php
- Code: Select all
<?
function replace_for_mod_rewrite(&$s) {
$urlin = array("'(?<!/)news.php\?id=([0-9]*)'","'(?<!/)affiliates.php'","'(?<!/)addnews.php'",);
$urlout = array("news\\1.html","affiliates.html","addnews.html",);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
?>
.htaccess
- Code: Select all
RewriteEngine on
RewriteRule /index.html /index.php
#News
RewriteRule ^news([1-9][0-9]*).html news.php?id=$1
#Affiliates
RewriteRule ^affiliates.html affiliates.php
#AddNews
RewriteRule ^addnews.html addnews.php
But always i get a 403 error.
what am I doing wrong?
Thanks All
Ciao