StupidScript - 9:31 pm on Jul 16, 2010 (gmt 0)
As a precursor to posting my own issues with Rewrite, let's break down the the RewriteRule in this thread:
RewriteRule ^(.*)\.html$ /scripts/gateway.php?action=SomeStaticAction§ion=$1 [NC]
^ = beginning of the string to test
(.*) = any number of any character(s) placed in a match container
\. = escape the period (checks for a period, not 'any character')
html = string 'html'
$ = end of the string to test
This seems to MATCH index.html, thing.html, etc.
This is the PATTERN to seek, yes? Any number of any character(s) at the beginning of the test string followed by a period and the string 'html'.
Then the SUBSTITUTION:
/scripts/gateway.php?action=SomStaticAction§ion= = INCLUDE this string
$1 = referencing the contents of the first match container in the PATTERN ((.*))
[NC] = case-insensitive
Seems to say: "Take whatever is in the matching container in the PATTERN and include it at the end of the SUBSTITUTION string."
So the result should be:
SUBSTITUTION TO PERFORM:
I am bringing this up because this thread and a few others around town seem to be indicating that the PATTERN to be matched is
and the SUBSTITUTION is
"..to create nice URLs like example.com/SomeStaticAction.html"
I see that in subsequent messages, the OP seems to be sending everything into the /scripts/ directory and then rewriting everything back to get a "clean" URI with the second set of instructions, but in the first message it seems like the posted code would NOT result in a "clean" URI. Maybe that was a mistake? Maybe the first post should have ALSO included the second set of instructions? Otherwise, how could the OP have obtained "clean" URIs with what was posted?
I just don't get it.
What is in the "address bar" area before the rewrite?
What is in the "address bar" area after the rewrite?
Can someone please clarify the relationship between PATTERN and SUBSTITUTION? It seems exactly backwards in the first part of this thread, and unaddressed after that.