Hello i'm getting a problem with htaccess mod_rewrite, maybe someone here could reason for the the best direction.

my website has 1 primary file [index.php] all of the navigation is performed by passing vars within the url string eg

index.php?page=about

this really is working comfortable with my .htaccess [below]

domain.com/about

a few of the pages possess a second variable eg

index.php?page=event&eventID=42

this works too using the .htaccess below

domain.com/event/42

my issue is which i produce other other pages that need vars too eg

index.php?page=news&newsID=4 domain.com/news/42

index.php?page=map&venueID=4 domain.com/map/42

Can you really do that ?

Thanks ahead of time

.k

.htaccess

Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([^/\.]+)/*$ /index.php?page=$1 [L]
RewriteRule ^([^/\.]+)/*([^/\.]+)/*$ /index.php?page=$1&eventType=$2 [L]

Sure, simply do

RewriteRule ^([^/\.]+)/*$ /index.php?page=$1 [L]
RewriteRule ^event/([^/\.]+)/*$ /index.php?page=event&eventType=$1 [L]
RewriteRule ^news/([^/\.]+)/*$ /index.php?page=news&newsID=$1 [L]
RewriteRule ^map/([^/\.]+)/*$ /index.php?page=map&venueID=$1 [L]

Try these rules:

RewriteRule ^([^/.]+)/?$ /index.php?page=$1 [L]
RewriteRule ^map/([^/.]+)/?$ /index.php?page=map&venueID=$1 [L]
RewriteRule ^([^/.]+)/([^/.]+)/?$ /index.php?page=$1&$1ID=$2 [L]

Your /map/… Web addresses require a separate rule because the URL parameter isn't mapID but venueID. However the relaxation ought to be taught in third rule. However it would likely be simpler should you call the ID parameter just id.

Please make reference to below link, Hope this is useful.

http://www.generateit.net/mod-rewrite/