Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
# RewriteRule
RewriteRule (.*)/$ /?page=$1
http://www.example.com/contact and the pattern from ^(.*)/$ to ^([^/.]+)$ or similar. www.example.com/contact/1 and test for that using the pattern ^([^/.]+)/([^/.]+)$ or ^([^/.]+)/([0-9])$ (if it is always a single digit) or ^([^/.]+)/1$ (if it is always a "1") or similar.
Options +FollowSymLinks
RewriteEngine on
# RewriteRule
RewriteRule ^([^/.]+)$ /?page=$1
RewriteRule ^([^/.]+)/([^/.]+)$ /?page=$1&feedback=$2
[edited by: impfut at 5:52 pm (utc) on May 14, 2010]
example.com/wrongword or example.com/contact/9 etc. [b]ex[/b]ample.com[b]/?[/b]page=contact&feedback=1 or [b]www.[/b]example.com/[b]index.php[/b]?page=contact&feedback=1 and all other similar combinations.
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# RewriteCond1
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
# RewriteCond2
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# RewriteRule
RewriteRule ^([^/.]+)$ /?page=$1 [L]
RewriteRule ^([^/.]+)/([^/.]+)$ /?page=$1&feedback=$2 [L]