You’ve pretty much got it but please allow me to make a few comments for others:
Which - in [a-zA-Z0-9_-] represents a hyphen and which one(s) don’t? Because - is a metacharacter within a character range definition, it’s supposed to be place first so there will be no confusion … but last, as you have it, works, too.
Since you didn’t show anything else in your .htaccess file, I’ll assume that this is it … nothing more. If this is not the case, then the lack of a Last flag will force mod_rewrite to AND any subsequent RewriteRule (blocks) with this one - or this one with preceding blocks. Please learn to use the [L] as you would ; or } in PHP and/or JavaScript to avoid problems.
Because your redirection was not “absolute,” it was not redirected to www.MySite.com/yadda-yadda, merely an internal redirection to the RELATIVE link (article.php in the same directory as the .htaccess file). This is a minor point … unless you have an atypical setup.
As for your final point, without an external absolute redirection or a 301 redirection, you are correct that the original request will continue to be displayed. If you change directory levels with your redirection, though, this will be problematic as the browsers will believe they’re in the original directory (i.e., wrong depth so relative links will be offset). Because you’re using articles as a pseudo directory, this has likely been the cause of missing support files (unless you use absolute links or the HTML <base> tag). This is discussed in more detail in my signature’s tutorial.
And since I don’t have one, what are the ramifications?
Because your redirection was not “absolute,” it was not redirected to www.MySite.com/yadda-yadda, merely an internal redirection to the RELATIVE link (article.php in the same directory as the .htaccess file). This is a minor point … unless you have an atypical setup.
Again, you are dropping words, so I don’t understand…
Yes, I used a relative reference. (I thought that was better?!) What are you saying I should or should not do?
As for your final point, without an external absolute redirection or a 301 redirection, you are correct that the original request will continue to be displayed. If you change directory levels with your redirection, though, this will be problematic as the browsers will believe they’re in the original directory (i.e., wrong depth so relative links will be offset). Because you’re using articles as a pseudo directory, this has likely been the cause of missing support files (unless you use absolute links or the HTML <base> tag). This is discussed in more detail in my signature’s tutorial.
Regards,
DK
Not sure if I follow you.
I have a “Config” file which defines my DOCUMENT_ROOT and BASE_URL, so that should take care of any confusions as t where things point/exist. I also usually try and use absolute references in HTML so that links/pictures/etc don’t get messed up.