10-10-2007, 12:51 PM
|
#2 (permalink)
|
|
The Reckoner
Join Date: Sep 2007
Posts: 436
Thanks: 22
|
Hi Sam,
Try creating a new .htaccess file and adding the following code:
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^RewriteRule ^news/([0-9]+)-([^\/]+).html$ news.php?id=$1 [L]$
</IfModule>
What this should do is try to catch your news urls and then call news.php passing it the id from the url. As for protection, the in order for the url to be valid it must begin with news/ followed by a numeric value, followed by a hyphen and atleast one single letter, so for instance, this would be valid:
news/1-a.html
but this would not:
news/a-a.html
Hope this helps.
|
|
|
|