I am migrating from a zeus platform to apache and having problems with the following rewrite:
/12345-somepage.html
/event.php?ref=12345
This is the .htaccess
RewriteEngine on
RewriteRule ^/([0-9]*)- /event.php?ref=$1 <-- This doesn't work 404 not found
RewriteRule ^otherpage.htm index.php?Month=0&Category=otherpage <- This one works
This is the exisiting Zeus rewrite rule:
match URL into $ with ^/([0-9]*)-
if matched then set URL = /event.php?ref=$1
I have verified that the target address works i.e. /event.php?ref=12345
Your default
RewriteBaseis/, that’s why you dont match a leading/, set theRewriteBaseto prevent unexpected behaviour, add modifier[L]so Apache stops processing the following rewrites after this matched, add[QSA]to append a query string from the original urlThis works:
my event.php
The output