Forum Moderators: phranque
When I do this
RewriteRule ^abc-page08-1.*$ /abc-page08-11/some-script.php [L]
but this
RewriteRule ^abc-page08-11.*$ /abc-page08-11/some-script.php [L]
Gets ignored and uses the 404.
I thought
RewriteRule ^abc-page08-1\1.*$ /abc-page08-11/some-script.php [L]
anything in a directory redirects to a script.This is not a redirect. It is an internal rewrite. It would be a redirect if the target contained http+domain name and/or the [R] flag. You do not want a redirect here. Rewrite is correct.
^abc-page08-1.*$The 1.*$ means "after the one, allow any number of digits, characters, and/or punctuation, or nothing in the path". Is that what you actually want?
^abc-page08-1 but this allows infinite duplicate content; as any URL variation will return content with "200 OK" status. You should allow only one canonical URL to be rewritten and serve content. That lowly / changes a rewrite into a redirect without having to type the whole http: thing at the beginning.It should not do that. Only http+domain and/or [R] should result in a redirect. Whenever I see that behaviour it has been because there is a redirect listed after that rewrite or there is a redirect affecting the current request defined in a .htaccess file in a subfolder. Both of those expose the rewritten filepath back out on to the web as a new URL.
This is not a redirect. It is an internal rewrite.
The 1.*$ means "after the one, allow any number of digits, characters, and/or punctuation, or nothing in the path". Is that what you actually want?
You didn't mention the test URL,
[F] is one of those rare occasions when you should omit the 'L' because you know exactly why it should be omitted.