This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
LinkFreeze (Forum Locked Forum Locked)
 Helicon Tech : LinkFreeze
Subject Topic: iis redirect for aspx to html
Author
Message |
chrispaton
Newbie


Joined: 02 February 2010
Posts: 9
Posted: 02 February 2010 at 10:42am

Hi guys,

I have linkfreeze working on iis and am in the process of moving from subdomains to main folders on the primary sub domain.

ie www.folder1.domain.co.uk to www.domain.co.uk/folder1/

I have a large amount of pages in the search engines and want to be able to redirect properly. I have setup the 'A permenant redierction for this resourse' in iis but this translates a .html url in the search engine listings to the .aspx as it is saved on the web server, it does not translate a .html to a .html. The .html pages work fine if I navigate myself to the correct url through the normal site links and link freeze is working fine for the dynamic url redirection when navigated through the new site links it is just the redirection from stored links that seems to be the problem.

I hope this makes sense and somebody can assist on how to redirect from the subdomain whilst maintaining the .html format through the new locations.

 

Thanks

 

 

Chris

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 03 February 2010 at 2:19am

You may use ISAPI_Rewrite to perform desired redirection. I guess it will be something like this:

RewriteBase /
RewriteRule ^folder/(.*\.html)$ $1 [NC,R=301,L]

__________________
Regards,
Anton
Back to Top
 
chrispaton
Newbie


Joined: 02 February 2010
Posts: 9
Posted: 03 February 2010 at 4:08am

Hi Anton,

Thanks for the response, I have setup the ISAPI_Rewrite on the server but could do with a bit of assistance on where to add the rules for each sub domain.

Each subdomain is setup as an indivual website, would I need to retain these or can I delete these and add a new global rule for each subdomain to redirect to the new virtual directory I have setup withing the main domain.

 

Thanks


Chris

Back to Top
 
chrispaton
Newbie


Joined: 02 February 2010
Posts: 9
Posted: 03 February 2010 at 5:14am

I have tried adding this to the virtual directory htaccess of the new location domain.co.uk/folder/ but I get errors that the page cannot be found.

I have also tried adding this in to the root domain htaccess but nothing happens

Thanks

 

Chris

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 03 February 2010 at 5:17am

You can use the following in your global config:

RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.domain\.co\.uk$ [NC]
RewriteRule .? http://www.domain.co.uk/%1 [NC,R=301,L]

__________________
Regards,
Anton
Back to Top
 
chrispaton
Newbie


Joined: 02 February 2010
Posts: 9
Posted: 03 February 2010 at 5:33am

I have tried adding that to the httpd.conf and to the htaccess for the main domain but nothing happens here is the exact text I have in the files;

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.69

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.toroholidays\.co\.uk$ [NC]
RewriteRule .? http://www.toroholidays.co.uk/%1 [NC,R=301,L]

do I still need to have the redirect setup in iis or can I should I delete the subdomain node

Thanks

Chris

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 03 February 2010 at 6:18am

Firstly, you need this config in httpd.conf only; don't duplicate it in .htaccess.
Secondly, try removing the redirection setup in IIS.

__________________
Regards,
Anton
Back to Top
 
chrispaton
Newbie


Joined: 02 February 2010
Posts: 9
Posted: 03 February 2010 at 6:42am

still nothing happening, I only have the config in the httpd.conf and have remove the redirect in IIS.

I have tried existing subdomains and dummy subdomains but nothing redirects

Thanks

Chris

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 03 February 2010 at 8:10am

Then please enable logging in httpd.conf as per instructions in our FAQ
and provide rewrite.log records for the testing request you make.

__________________
Regards,
Anton
Back to Top
 
chrispaton
Newbie


Joined: 02 February 2010
Posts: 9
Posted: 03 February 2010 at 8:23am

Here is the rewite log for the test subdomain I tried

217.41.44.60 217.41.44.60  Wed, 03-Feb-2010  13:51:47 GMT [www.subdomain.toroholidays.co.uk/sid#1][rid#20000456/initial] (2) init rewrite engine with requested uri /pagerror.gif
217.41.44.60 217.41.44.60  Wed, 03-Feb-2010  13:51:47 GMT [www.subdomain.toroholidays.co.uk/sid#1][rid#20000456/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
217.41.44.60 217.41.44.60  Wed, 03-Feb-2010  13:51:47 GMT [www.subdomain.toroholidays.co.uk/sid#1][rid#20000456/initial] (3) applying pattern '.?' to uri '/pagerror.gif'
217.41.44.60 217.41.44.60  Wed, 03-Feb-2010  13:51:47 GMT [www.subdomain.toroholidays.co.uk/sid#1][rid#20000456/initial] (4) RewriteCond: input='www.subdomain.toroholidays.co.uk' pattern='^(?!www)([^.]+)\.toroholidays\.co\.uk$' => not-matched

Back to Top
 
chrispaton
Newbie


Joined: 02 February 2010
Posts: 9
Posted: 03 February 2010 at 8:27am

Can I specify the exact subdomain to redirect, would that resolve part of the issue with matching the subdomain to redirect
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 03 February 2010 at 9:06am

Ok, I see now. Small fix for the rules:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.([^.]+)\.toroholidays\.co\.uk$ [NC]
RewriteRule .? http://www.toroholidays.co.uk/%1%{REQUEST_URI} [NC,R=301,L]

__________________
Regards,
Anton
Back to Top
 
chrispaton
Newbie


Joined: 02 February 2010
Posts: 9
Posted: 03 February 2010 at 9:14am

Perfect! all seems to be working, tested a few redirects from indexed pages on google and redirects to the correct page

Many thanks for your persistance.

Chris

Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
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