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


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


a few of the pages possess a second variable eg


this works too using the .htaccess below


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



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.