Making SEO friendly URL...using .htaccess file....Need Help


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…

								$caste = $_POST['religon'];
								$loginID = $_POST['gender'];
							if($_SERVER["REQUEST_METHOD"] == "POST")
								$newtitle=string_limit_words($title, 6);
								$urltitle=preg_replace('/[^a-z0-9]/i',' ', $newtitle);
								$newurltitle=str_replace(" ","-",$newtitle);
								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.

In your code it’s missing a quote at the seting of $url, correct: