Hi,
I am making an SEO friendly URL so that I can hide the parameters form the visitors. I am using .htaccess files to redirect it.
Its working fine when I created it to view profiles…where I call database…
But When I used it to search results Form $_POST Method…it flagging up with the result URL not Found.
.htaccess file Contains this:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9-/]+).html$ profile.php?url=$1
RewriteRule ^([a-zA-Z0-9-/]+).html/$ profile.php?url=$1
This is how I am redirecting…
$blog='';
$caste = $_POST['religon'];
$loginID = $_POST['gender'];
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$title=mysql_real_escape_string($loginID);
$body=mysql_real_escape_string('');
$title=htmlentities($title);
$body=htmlentities($body);
$date=$caste;
$newtitle=string_limit_words($title, 6);
$urltitle=preg_replace('/[^a-z0-9]/i',' ', $newtitle);
$newurltitle=str_replace(" ","-",$newtitle);
$url=keyword/'.$date.'/'.$newurltitle.'.html';
$blogurl="http://localhost/website/$url";
mysql_query("insert into blog(title,body,url) values('$title','$body','$url')");
//header("Location: $blogurl");
echo "<a style=\\"color:#1591d2;\\" href=\\"$blogurl\\">View Profile</a>";
}
Please let me know if I mistook somewhere…
Your help would be appreciated.