Forum Moderators: phranque
[127.0.0.1...]
to
[127.0.0.1...]
I was having trouble getting the non greedy operator to work and stumbled upon the code below which works on my computer but does not work on the native server.
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^Magic-The-Gathering/([^\.]*?)-Card-List\.html$ index.php?page=Cards&edition=$1
Could someone please help me to get this rewrite to work. I suspect it is something simple but it has continued to elude me.
Thanks!
Since you're trying to grab everything in the "first-level subdirectory" up to the "-Card-List," you need to be looking for "not a slash" rather than "not a period." To avoid using the non-greedy "*?" extended-regex quantifier, you could use:
RewriteRule ^Magic-The-Gathering/([^/]+)-Card-List\.html$ index.php?page=Cards&edition=$1
The regex processor *is* going to have to go through multiple "back-off-and-retry" cycles to get a match.
Be aware that the processing of regular expressions depends on the particular POSIX library bundled with the operating system, and not upon the Apache version.
Jim