dk,
i believe i was trying to do that and for whatever reason, it wasn't working properly. Maybe i wrote the line incorrectly (which is most likely the case). Either way, that is what i wanted, but i still cannot find the solution to taking out those extra blocks of code.
Code:
rewriterule ^(([^/]*/)*) ...
# can more easily be coded as
rewriterule ^(.*) ...
# or, better yet, without anything preceding the index\.
just a suggestion, of course.
should the force to www or non-www be the first block after i turn the rewrite engine on?
because that will be universally applied (unless you change things later), that is what i would do.
first off, it confused the heck out of me (newbie here

). Then, i kept receiving a internal server 500 error document while trying to utilize it...
i included the explanation in the tutorial but it is non-trivial:
Code:
Rewrite Engine on
RewriteCond %{HTTP_HOST}/s%{HTTPS} ^www\.([^/]+)/((s)on|s.*)$ [NC]
RewriteRule .? http%3://%1%{REQUEST_URI} [R=301,L]
RewriteCond:
The {HTTP_HOST} will always be available.
/s is a dummy variable which is to be matched (or not) within the following regex
{HTTPS} will either be 'on' or null (no value)
RewriteCond regex:
Assuming you've forced www, www will be matched.
([^/]+) will be the domain including the TLD (extension)
(
(s)on|s.*) will attempt to match either
(s)on or s
xxx so, if {HTTPS} is 'on', '
(s)on' will be matched, otherwise s with anything will be matched. The key here is that we're only interested in the
(s) of
(s)on which has been captured as
%3 which is then used in the redirection:
Code:
RewriteRule .? http%3://%1%{REQUEST_URI}
exactly. But, i want to learn the proper way and that is why i am looking for additional thoughts and suggestions to help me understand what i am doing wrong and why. Then ultimately, how to fix it.
other than your tutorial, do you have any other solid resources to help my learning process along?
I'd included a couple of "references" at the bottom of that LONG tutorial. The only thing I can do is warn you that there are a lot of people out there with tutorials which I consider garbage as they seem to rely on (.*) which is the leading cause of problems that newbies have with mod_rewrite.
Thanks again for your help and feedback dklynn!
Bookmarks