Forum Moderators: phranque
RewriteRule ^page-([^.]+)-([^.]+)\.html$ /page.php?model=$1&make=$2 [L]
works fine for page-sedan-ford.html
runs into trouble with page-sedan-mercedes-benz.html
Is this a problem only on a Unix server? I think it has something to do with PERL maybe? Any ideas on getting around this?
The regex should probably look more like this (untested):
^page-([^-]+?)-([^\.]+)\.html$
i.e. "page [hyphen] (everything that's not a hyphen) hyphen (everyhing that's not a full stop) [fullstop] html
assuming that's the pattern you want to match.
php?model=sedan-mercedes&make=benz
I can't believe nobody has had this problem before. I really don't know PERL but from what I've been reading up on I think it really has something to do with that and Unix. Oh well, thanks for trying anyway.
I can't believe nobody has had this problem before. I really don't know PERL but from what I've been reading up on I think it really has something to do with that and Unix.
Well, if you really want to keep thinking that, I can't help you :-/. The only connection with Perl is possibly that Apache uses the PCRE library; but the problem is that your regex is not working because it's evidently wrong.
Try this instead, after flushing your browser cache:
RewriteRule ^page-([a-z]+)-([a-z\-]+)\.html$ /page.php?model=$1&make=$2 [NC,L]
Jim