Hi, i'm trying to do clean url's using .htaccess but i'm having problems.
Here i have my .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^([a-z]+)\/([0-9]+)\/?$ parameter_letter_and_number.php?param=$1¶m2=$2 [NC]
RewriteRule ^([a-z]+)\/?$ $1.php [NC]
RewriteRule ^([0-9]+)\/?$ parameter_number.php?param=$1 [NC]
RewriteRule ^([0-9_]+)\/?$ parameter_number_and_underscore.php?param=$1 [NC]
</IfModule>
Here is my parameters page so i can test:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Clean URL tutorial with .htaccess and PHP by http://codeofaninja.com/</title>
</style>
</head>
<body>
<h1>Parameter: Letter and Number ONLY. This is parameter_letter_and_number.php</h1>
<?php
echo "PARAMETER VALUE 1: " . $_REQUEST['param'];
echo "<br />";
echo "PARAMETER VALUE 2: " . $_REQUEST['param2'];
?>
</body>
</html>
it should appear somthing like this:
http://localhost/clean-urls/post/143
but in that way gives me 404 Error it works only if the url is http://localhost/clean-urls/parameter_letter_and_number.php?param=post¶m2=143
Can someone help me please?
Thank You,
PF2G