I have been researching htaccess and learning quite a bit about it, but I'm still stuck on a very specific requirement we have. Actually there are 2 requirements, but one of them is critical while the other one is a "would be very nice."
Question 1: What is the best way to write my htaccess file for an MLM site written on MVC framework that would allow users to type www.mlmsiteaddress.org/aff/affiliatename when the site does not accept www?
Background: This software allows inserting new members, then provides that new member with a URL for which their affiliate identifier, email, phone number, address, etc show up on the banner and underneath which is a "squeeze page," or very simple opt-in form which brings in new leads to the company and other things that happen after this form submits don't have any bearing on this question.
Problem: When users click a link, or type in manually, the URL www.mlmsiteaddres.org/aff/affiliatename, it does not display the affiliate banner info. Instead, it shows just the corporate banner, which is the default affiliate in case the user had attempted to navigate to an inactive affiliate's site. For some reason this wasn't an issue before but has recently become an issue, shortly after I cleaned up a BLACOLE/JS virus off the site. From what I can ascertain, the htaccess file we are using now is identical to how it came to us from the software vendor.
Normal Behavior: Previously, the www portion of the URL was being simply ignored, and the site was loading http://mlmsiteaddress.org in the url for each affiliate site. So, even though the affiliate banner information would show up, the affiliate name would not populate in the URL. Which brings me to...
Question 2: How can I force the URL to display the affiliate username in the banner when on an affiliate page using htaccess?
Question 3: Is htaccess the only way to do these things (assuming both of these are possible)? I have some basic working knowledge of it but am no expert, though I'll have a far richer understanding once I solve this problem!
Here is the htaccess that is currently being used (which came with the mlm software "out of the box" so to speak).
<Files ~ "serial.txt$">
Order allow,deny
Deny from all
</Files>
RewriteEngine On
RewriteRule ^aff/(.*)$ /index.php/aff/?aff=$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [R=301,NC]