Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: URL-rewrite to URL without ’www’ Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
MartijnValk
Newbie
Newbie


Joined: 08 July 2008
Online Status: Offline
Posts: 2
Posted: 08 July 2008 at 6:34am | IP Logged Quote MartijnValk

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 View MartijnValk's Profile Search for other posts by MartijnValk
 
Kevin Collins
Groupie
Groupie


Joined: 08 April 2003
Location: United States
Online Status: Offline
Posts: 63
Posted: 08 July 2008 at 11:28am | IP Logged Quote Kevin Collins

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 View Kevin Collins's Profile Search for other posts by Kevin Collins
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 3934
Posted: 09 July 2008 at 2:11am | IP Logged Quote Anton

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 View Anton's Profile Search for other posts by Anton
 
MartijnValk
Newbie
Newbie


Joined: 08 July 2008
Online Status: Offline
Posts: 2
Posted: 11 July 2008 at 3:01am | IP Logged Quote MartijnValk

Thnx guys! Today we'll migrate the test site to the live one, I'll let you know the results!  
Back to Top View MartijnValk's Profile Search for other posts by MartijnValk
 
brianowd
Newbie
Newbie


Joined: 17 July 2008
Online Status: Offline
Posts: 9
Posted: 17 July 2008 at 11:20pm | IP Logged Quote brianowd

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 View brianowd's Profile Search for other posts by brianowd Visit brianowd's Homepage
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 412
Posted: 18 July 2008 at 5:58am | IP Logged Quote Vyacheslav

Hi brianowd.
Please write some examples of non-working requests.

__________________
Kind regards!
Vyacheslav.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
brianowd
Newbie
Newbie


Joined: 17 July 2008
Online Status: Offline
Posts: 9
Posted: 18 July 2008 at 8:50am | IP Logged Quote brianowd

Based on the example, I believe http://heromemorials.com/ should rewrite and go to http://www.heromemorials.com/
Back to Top View brianowd's Profile Search for other posts by brianowd Visit brianowd's Homepage
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 412
Posted: 18 July 2008 at 8:57am | IP Logged Quote Vyacheslav

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 View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
brianowd
Newbie
Newbie


Joined: 17 July 2008
Online Status: Offline
Posts: 9
Posted: 22 July 2008 at 11:16pm | IP Logged Quote brianowd

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 View brianowd's Profile Search for other posts by brianowd Visit brianowd's Homepage
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 412
Posted: 23 July 2008 at 5:48am | IP Logged Quote Vyacheslav

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 View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
brianowd
Newbie
Newbie


Joined: 17 July 2008
Online Status: Offline
Posts: 9
Posted: 23 July 2008 at 7:28am | IP Logged Quote brianowd

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 View brianowd's Profile Search for other posts by brianowd Visit brianowd's Homepage
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 412
Posted: 23 July 2008 at 8:18am | IP Logged Quote Vyacheslav

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 View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
brianowd
Newbie
Newbie


Joined: 17 July 2008
Online Status: Offline
Posts: 9
Posted: 23 July 2008 at 1:28pm | IP Logged Quote brianowd

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 View brianowd's Profile Search for other posts by brianowd Visit brianowd's Homepage
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 3934
Posted: 24 July 2008 at 2:51am | IP Logged Quote Anton

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 View Anton's Profile Search for other posts by Anton
 
brianowd
Newbie
Newbie


Joined: 17 July 2008
Online Status: Offline
Posts: 9
Posted: 24 July 2008 at 7:54am | IP Logged Quote brianowd

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 View brianowd's Profile Search for other posts by brianowd Visit brianowd's Homepage
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 3934
Posted: 25 July 2008 at 3:06am | IP Logged Quote Anton

Are you using Full or Lite version?
And are you putting your rules in .htaccess or httpd.conf?


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
jonc
Newbie
Newbie


Joined: 25 July 2008
Location: United States
Online Status: Offline
Posts: 1
Posted: 25 July 2008 at 7:22am | IP Logged Quote jonc

Full, and placing rules in the .htaccess.

Jon C.
Back to Top View jonc's Profile Search for other posts by jonc Visit jonc's Homepage
 
brianowd
Newbie
Newbie


Joined: 17 July 2008
Online Status: Offline
Posts: 9
Posted: 27 July 2008 at 10:37am | IP Logged Quote brianowd

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 View brianowd's Profile Search for other posts by brianowd Visit brianowd's Homepage
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 3934
Posted: 28 July 2008 at 3:16am | IP Logged Quote Anton

Can you please provide all rewrite log records for the specific request (specifying url).

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
brianowd
Newbie
Newbie


Joined: 17 July 2008
Online Status: Offline
Posts: 9
Posted: 28 July 2008 at 11:48am | IP Logged Quote brianowd

Anton,

I did that above. Look at the Post for:

Posted: 24 July 2008 at 7:54am

Thanks,

Brian A
Back to Top View brianowd's Profile Search for other posts by brianowd Visit brianowd's Homepage
 

Page of 2 Next >>
  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum