| Author |
|
MartijnValk Newbie

Joined: 08 July 2008
Online Status: Offline Posts: 2
|
| Posted: 08 July 2008 at 6:34am | IP Logged
|
|
|
Hello all,
On the Helicon example-page there is an example which shows how to redirect from non-'www' version to 'www'. I want to accomplish the direct opposite. So, when someone type 'www.mysite.com', I want them to see 'http://mysite.com' in the address bar.
Can someone tell me how to do this? (or better, post the lines to accomplish this? )
Thnx in advance!
|
| Back to Top |
|
| |
Kevin Collins Groupie

Joined: 08 April 2003 Location: United States
Online Status: Offline Posts: 63
|
| Posted: 08 July 2008 at 11:28am | IP Logged
|
|
|
Try this (not tested though)...
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://%2%3 [R=301,L]
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 3934
|
| Posted: 09 July 2008 at 2:11am | IP Logged
|
|
|
A small correction:
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?:www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://%2%3 [R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
MartijnValk Newbie

Joined: 08 July 2008
Online Status: Offline Posts: 2
|
| Posted: 11 July 2008 at 3:01am | IP Logged
|
|
|
Thnx guys! Today we'll migrate the test site to the live one, I'll let you know the results!
|
| Back to Top |
|
| |
brianowd Newbie

Joined: 17 July 2008
Online Status: Offline Posts: 9
|
| Posted: 17 July 2008 at 11:20pm | IP Logged
|
|
|
I am trying to help a customer get this working on their site. We have
Isapi_Rewrite v3 licensed on the server. We are using the sample
mentioned which I will paste below, and it's not working. What do I need
to check or change?
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
Thank you,
Brian A
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 412
|
| Posted: 18 July 2008 at 5:58am | IP Logged
|
|
|
Hi brianowd.
Please write some examples of non-working requests.
__________________ Kind regards!
Vyacheslav.
|
| Back to Top |
|
| |
brianowd Newbie

Joined: 17 July 2008
Online Status: Offline Posts: 9
|
| Posted: 18 July 2008 at 8:50am | IP Logged
|
|
|
Based on the example, I believe http://heromemorials.com/ should rewrite and go to http://www.heromemorials.com/
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 412
|
| Posted: 18 July 2008 at 8:57am | IP Logged
|
|
|
Hi brianowd.
Please try the following:
Code:
RewriteBase /
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteRule (.*) http://%1/$1 [R=301,L]
|
|
|
__________________ Kind regards!
Vyacheslav.
|
| Back to Top |
|
| |
brianowd Newbie

Joined: 17 July 2008
Online Status: Offline Posts: 9
|
| Posted: 22 July 2008 at 11:16pm | IP Logged
|
|
|
Unfortunately that did not work. I know Isapi_Rewrite is installed on the
server. Is there a way to verify that this particular site recognizes that?
Brian A
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 412
|
| Posted: 23 July 2008 at 5:48am | IP Logged
|
|
|
Hi Brian.
Please try the following rule with the small correction:
Code:
RewriteBase /
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteRule (.*) http://www.%1/$1 [R=301,L]
|
|
|
Also please provide some examples of non-working requests.
__________________ Kind regards!
Vyacheslav.
|
| Back to Top |
|
| |
brianowd Newbie

Joined: 17 July 2008
Online Status: Offline Posts: 9
|
| Posted: 23 July 2008 at 7:28am | IP Logged
|
|
|
I have tried that too, no success. Nothing was written to the error logs
either. Is there a way to debug what is happening?
The example of non-working is:
http://heromemorials.com/
should redirect to:
http://www.heromemorials.com/
Thanks,
Brian A
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 412
|
| Posted: 23 July 2008 at 8:18am | IP Logged
|
|
|
Please write these strings in your httpd.conf:
Code:
RewriteLogLevel 9
LogLevel debug
|
|
|
Then make some request and provide to us your rewrite.log file.
__________________ Kind regards!
Vyacheslav.
|
| Back to Top |
|
| |
brianowd Newbie

Joined: 17 July 2008
Online Status: Offline Posts: 9
|
| Posted: 23 July 2008 at 1:28pm | IP Logged
|
|
|
The rewrite.log is empty.
I even reinstalled. Here's the message from the error log, showing it's
loading:
[7/23/2008 12:58:02] ISAPI Filter loaded. Version 3.1.0.53. Windows 5.2
(Build 3790 ServicePack:2) ProductType SERVER. CPU type INTEL
NumberOfProcessors 8.
The Helicon Manager shows this for this site:
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.53
RewriteEngine on
RewriteLogLevel 9
LogLevel debug
RewriteBase /
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteRule (.*) http://www.%1/$1 [R=301,L]
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 3934
|
| Posted: 24 July 2008 at 2:51am | IP Logged
|
|
|
Firstly, make sure you've put logging directives into httpd.conf not .htaccess. Also please check if you don't use any other ISAPI filters. And set permissions as per http://www.helicontech.com/isapi_rewrite/doc/security.htm
__________________ Regards,
Anton
|
| Back to Top |
|
| |
brianowd Newbie

Joined: 17 July 2008
Online Status: Offline Posts: 9
|
| Posted: 24 July 2008 at 7:54am | IP Logged
|
|
|
Getting the logging directives in the right location helped. I also made sure
the site is not using any other ISAPI Filter. Here is the result from the log:
x.x.x.x x.x.x.x Thu, 24-Jul-2008 06:44:00 GMT
[heromemorials.com/sid#63309][rid#21771408/initial] (2) init rewrite
engine with requested uri /
x.x.x.x x.x.x.x Thu, 24-Jul-2008 06:44:00 GMT
[heromemorials.com/sid#63309][rid#21771408/initial] (1) Htaccess process
request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
Brian A
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 3934
|
| Posted: 25 July 2008 at 3:06am | IP Logged
|
|
|
Are you using Full or Lite version? And are you putting your rules in .htaccess or httpd.conf?
__________________ Regards,
Anton
|
| Back to Top |
|
| |
jonc Newbie

Joined: 25 July 2008 Location: United States
Online Status: Offline Posts: 1
|
| Posted: 25 July 2008 at 7:22am | IP Logged
|
|
|
Full, and placing rules in the .htaccess.
Jon C.
|
| Back to Top |
|
| |
brianowd Newbie

Joined: 17 July 2008
Online Status: Offline Posts: 9
|
| Posted: 27 July 2008 at 10:37am | IP Logged
|
|
|
As Jon noted, we are using Full and placing the rules in .htaccess since
this is v3.
We have 30 licenses and have it installed on 26 servers. This is the first
one I can remember that just doesn't work. We have now tried moving
the site to a different server also with v3 installed and testing a pre-
propagation URL, it didn't work either, but it showed in the same results
in the log.
Any more ideas?
Thank you,
Brian A
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 3934
|
| Posted: 28 July 2008 at 3:16am | IP Logged
|
|
|
Can you please provide all rewrite log records for the specific request (specifying url).
__________________ Regards,
Anton
|
| Back to Top |
|
| |
brianowd Newbie

Joined: 17 July 2008
Online Status: Offline Posts: 9
|
| Posted: 28 July 2008 at 11:48am | IP Logged
|
|
|
Anton,
I did that above. Look at the Post for:
Posted: 24 July 2008 at 7:54am
Thanks,
Brian A
|
| Back to Top |
|
| |