| Author |
|
vartana Newbie

Joined: 25 September 2008
Online Status: Offline Posts: 4
|
| Posted: 25 September 2008 at 4:30pm | IP Logged
|
|
|
Hi, im on a win2k3 server with ver3 of rewrite. I have manually added the extension and enabled it and have set permissions to the files.
I have used the utility to add to http.conf
# 301 redirect from domain.com to www.domain.com RewriteCond Host: (?!www\.)(.*) RewriteCond METHOD GET|HEAD RewriteCond %HTTPS (on)|.* RewriteRule (.*) http(?2s:)\://www.$1$3 [I,RP]
when i goto https:// domain.com it does not redirect to https://www.domain.com. What am i missing?
Thank You.
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4837
|
| Posted: 26 September 2008 at 3:35am | IP Logged
|
|
|
Please try to apply this config:
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
vartana Newbie

Joined: 25 September 2008
Online Status: Offline Posts: 4
|
| Posted: 26 September 2008 at 12:23pm | IP Logged
|
|
|
That worked for http:// but not https:// Any ideas of what it can be?
Anton wrote:
Please try to apply this config:
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
|
|
|
|
| Back to Top |
|
| |
vartana Newbie

Joined: 25 September 2008
Online Status: Offline Posts: 4
|
| Posted: 27 September 2008 at 9:07pm | IP Logged
|
|
|
Anton thank you for your replay can you also help me by telling me how to make it only rewrite first level domains.
right now if i type admin.domain.com it will make it www.admin.domain.com, i just want it to be done to first level domains. I am also still having an issue where it does not effect https://
Anton wrote:
Please try to apply this config:
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
|
|
|
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4837
|
| Posted: 29 September 2008 at 6:11am | IP Logged
|
|
|
https requests should be processed ok. Please check if https is enabled for your site.
And to make it work for first level domains only, please use this:
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)([^.].+)\.com$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
vartana Newbie

Joined: 25 September 2008
Online Status: Offline Posts: 4
|
| Posted: 29 September 2008 at 2:00pm | IP Logged
|
|
|
Anton https is enabled and when i goto https://domain.com it goes just fine, but i need it to rewrite it to https://www.domain.com
The problem im having with the code you provided now is if i type http://admin.domain.com it forwards to http://www.admin.domain and still has no effect on https
Anton wrote:
https requests should be processed ok. Please check if https is enabled for your site.
And to make it work for first level domains only, please use this:
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)([^.].+)\.com$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L] |
|
|
Edited by vartana - 29 September 2008 at 2:08pm
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4837
|
| Posted: 30 September 2008 at 5:12am | IP Logged
|
|
|
Please provide rewrite log records for the request http://admin.domain.com and for some https request.
__________________ Regards,
Anton
|
| Back to Top |
|
| |