| Author |
|
panderson Newbie

Joined: 18 September 2008
Online Status: Offline Posts: 5
|
| Posted: 18 September 2008 at 10:46am | IP Logged
|
|
|
Great product you have here!! I have it setup to redirect our site from the non-www to the www but the problem I'm having is it's also trying to redirect our intranet site. I'm using the free version because we only have one public facing site but was hoping for a way to do the redirect unless the site is 'intranet'.
I'm using the following rule straight from your example page.
RewriteEngine on
#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]
#Redirect HTTPS to non-HTTPS
RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? http://%1%2 [R,L]
|
| Back to Top |
|
| |
panderson Newbie

Joined: 18 September 2008
Online Status: Offline Posts: 5
|
| Posted: 18 September 2008 at 5:23pm | IP Logged
|
|
|
I can purchase the full version if that is the only way to do this... it's just one site I need it to not redirect to the www version though.
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Online Posts: 4837
|
| Posted: 19 September 2008 at 3:06am | IP Logged
|
|
|
Please try to fix your config like this:
RewriteEngine on
#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]
#Redirect HTTPS to non-HTTPS
RewriteCond %{HTTP:Host} ((?:www\.)?externalsite\.com)
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? http://%1%2 [R,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Online Posts: 4837
|
| Posted: 19 September 2008 at 3:14am | IP Logged
|
|
|
Please try to fix your config like this:
RewriteEngine on
#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]
#Redirect HTTPS to non-HTTPS
RewriteCond %{HTTP:Host} ((?:www\.)?externalsite\.com)
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? http://%1%2 [R,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
panderson Newbie

Joined: 18 September 2008
Online Status: Offline Posts: 5
|
| Posted: 19 September 2008 at 9:19am | IP Logged
|
|
|
Outstanding... I used your last reply and it seems to be working perfectly. THANKS!
|
| Back to Top |
|
| |
panderson Newbie

Joined: 18 September 2008
Online Status: Offline Posts: 5
|
| Posted: 19 September 2008 at 10:46am | IP Logged
|
|
|
Argh... I think I spoke to soon. Let me run down what I'm trying to accomplish to make sure it's clear. We have a websites domain.com and google has indexed a bunch of pages for https://domain.com and what I would like to do is anybody that goes to domain.com or the secure domain.com gets redirected to the www version.
The rewrite you posted seems to throw it into a loop when I try to go the secure portion of my site at www.domain.com
|
| Back to Top |
|
| |
panderson Newbie

Joined: 18 September 2008
Online Status: Offline Posts: 5
|
| Posted: 19 September 2008 at 12:34pm | IP Logged
|
|
|
OK, I've modified the above to the following so it only does this if the port is 443 since my intranet is not on SSL. This seems to be working... is there any issues doing it this way?
RewriteEngine on
RewriteCond %{HTTPS} (on)? RewriteCond %{SERVER_PORT} ^443$ RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC] RewriteCond %{REQUEST_URI} (.+) RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
|
| Back to Top |
|
| |