How can I have Example 1 and Example 2 both point to Example 3 using mod rewrite. so far I can point to Example 2.
Example 1
http://www.example.com/posts/1/abcd/
Example 2
http://www.example.com/posts/1/abcd
Example 3
http://www.example.com/posts.php?aid=1
Here is my mode rewrite
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^posts/([^/]*)/([A-Za-z0-9-]+)$ /posts.php?aid=$1 [L]
</IfModule>
You must add (/?) at the end of the regular expression to say that there can be one or no / char AND you have to remove the beginning ^ char what stands for the beginning of a line: