Reply
Apache .htaccess - [mod_rewrite] Help
Old 12-14-2006, 06:53 PM Apache .htaccess - [mod_rewrite] Help
Kiros72's Avatar
Average Talker

Posts: 16
Name: Kiros
Location: Albany, LA - USA
Hey, could anyone explain to me what this code do - mainly, the two rules at the end? I'm somewhat new to .htaccess syntax and whatnot

Code:
# subdomain logic
RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^domain\.com [NC]
RewriteCond %{HTTP_HOST} ^([A-Z0-9a-z-]+)\.domain\.com [NC]
RewriteCond %{DOCUMENT_ROOT}/%1 -d
RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
RewriteRule ^([0-9A-Za-z-]+)\.domain\.com/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]
# end subdomain logic
The problem is my server always sends a "Vary: Host" HTTP header with subdomains. This causes my subdomains to not work correctly with IE and all of it's shell-browsers. I can see that the first two RewriteCond-itions basically exclude the base domain and www prefix - which, possibly by coincidence, do not have the "Vary: " HTTP header problem.

Could anyone confirm what the two rules actually do?

Thanks,
//KiroS
Kiros72 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 12-15-2006, 08:21 AM Re: Apache .htaccess - [mod_rewrite] Help
Kiros72's Avatar
Average Talker

Posts: 16
Name: Kiros
Location: Albany, LA - USA
I do need a confirmation sometime soon. My tech support thinks it's my fault and they keep closing my support ticket unless I can supply a reason and a solution... Some tech support...
Kiros72 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Apache .htaccess - [mod_rewrite] Help
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13584 seconds with 12 queries