This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: httpd.ini 301 Redirects - HELP!
Author
Message |
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 16 September 2011 at 11:15am

Hello All

I am new to this httpd.ini 301 redirects thing, but I've been told by my host that I have to use it to redirect my old html files to the new ASP files (hosted on a IIS windows server) and cannot use htaccess (not that i knew that very well anyway)

I have been all over the internet trying out a large variety of recommend code options, none of which seem to work for me. Very frustrating.

I'm a bit of a beginer and more of a designer than a developer (although I have been learning more and more these past few years!) So please spell it out simply for me.

There is a load of files to redirect, but to begin with I was trying to redirect floatingfloors.html to floatingfloors.asp

also a load of the old html files are in a directory called /pages/ but the new ASP files are in the root. So if you could tell me the code for that as well I would appreciate it.

Thanks

Rich

P.S

This is the latest code I tried:

RewriteCond Host: mason-uk\.co.uk
RewriteRule /floatingfloors.html /floatingfloors.asp [I,L]



__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 19 September 2011 at 3:59am

Another piece of code that I previously tried:

RewriteEngine on
RewriteRule ^floatingfloors\.html$ floatingfloors.asp [NC,R=301]



__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 
Lexey
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Posts: 8119
Posted: 19 September 2011 at 4:09am

The correct rule is:

Code:

RewriteCond Host: mason-uk\.co\.uk
RewriteRule /pages/floatingfloors\.html http\://mason-uk.co.uk/floatingfloors.asp [I,RP]


However, if you are going to redirect a large number of old links it would be better to use mapping (if your hoster has the latest ISAPI_Rewrite 2 build installed):

Code:

UriMatchPrefix /pages/
UriFormatPrefix http://mason-uk.co.uk/

MapUri [I,RP]
{
floatingfloors.html floatingfloors.asp
}

UriMatchPrefix
UriFormatPrefix


Edited by Lexey - 19 September 2011 at 4:10am
Back to Top
 
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 19 September 2011 at 5:14am

Hi Lexey,

Thanks for your reply.

I tried the first one you suggest, and it didnt work for me. How do I know whether my host support ISAPI_Rewrite 2? What are the other possibilities? I have submitted tickets to my host asking them but they keep trying to fob me off by telling me its a code problem and I should hire a webdesigner with redirect experience.

Also, I need to redirect some *.html pages that are in the root to other *.asp pages that are also in the root. Do I just simply remove the /pages/ from the first code you suggested?



__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 19 September 2011 at 8:14am

God my hosting company are idiots, they've just put meta redirects in the files! Doh!

I've emailed them back complaining about it.

Got any other suggestions? The hosting is Windows - with a IIS 6.0 Password Console. If it isnt ISAPI_Rewrite 2 what else could it be?



__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 19 September 2011 at 9:57am

I spoke to the host and they are using ISAPI_Rewrite 2

Any idea why this code doesnt work? Could it be an error on the host?



__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 
Lexey
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Posts: 8119
Posted: 20 September 2011 at 2:23pm

First, show me the complete contents of your httpd.ini.
Second, make sure that you have placed it into the web site root (not into a subdirectory).
Third, if ISAPI_Rewrite is correctly configured and you have place the httpd.ini into the right folder there should be a file name httpd.parse.error in the same folder. What contents does it have?
Finally, show me a sample URL that you are putting into a browser address bar to test the rule.
Back to Top
 
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 21 September 2011 at 4:41am

I think that my hosting company have something wrong with their hosting. They have now tried to trick me by putting some code in the httpd.ini (that didnt work) and then sticking meta redirects in! and the page the decided to try it on was the live contact page!
Anyway.

1. All the code I have given above (in other posts) (and below) is the total contents of the httpd.ini file (at any one time - not all together). There is nothing else in the file.

The code my host co recently put in the httpd.ini file is this:

RewriteRule /floatingfloors.html http://masonukcouk.yourwebhosting.com/floatingfloors.asp [I,O,RP,L]

But I have tried everything else mentioned on this forum page too and more!

2. The file is in the root folder (according to the filemanager anyway -whether this is the true root or not I do not know)

3. httpd.parse.error is totally empty and has been throughout

4. this is the old html page:
http://www.mason-uk.co.uk/floatingfloors.html

and this is the new ASP page that it should redirect to
http://www.mason-uk.co.uk/floatingfloors.asp

What I think:
I think that the host is screwed, but I can't get them to listen to me. I have been on the chat help facility and got nowhere as well as submitted a ton of tickets over the past 3 weeks. I have spent way to long trying to solve this issue and its really frustrating.

I really hope that you can suggest an solution Lexey. Thanks for your help so far


__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 21 September 2011 at 5:11am

Another piece of code I've tried is:

RewriteRule /floatingfloors.html http://www.mason-uk.co.uk/floatingfloors.asp [I,O,RP,L]


__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 
Lexey
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Posts: 8119
Posted: 22 September 2011 at 3:17am

AblazeGraphics wrote:
All the code I have given above (in other posts) (and below) is the total contents of the httpd.ini file (at any one time - not all together).


That is not sufficient. httpd.ini should start with
the
Code:

[ISAPI_Rewrite]

header.

Quote:
The code my host co recently put in the httpd.ini file is this:
Code:

RewriteRule /floatingfloors.html http://masonukcouk.yourwebhosting.com/floatingfloors.asp [I,O,RP,L]


That will not work unless floatingfloors.html is in the root folder. Also, there are some minor drawbacks.

Quote:
4. this is the old html page:http://www.mason-uk.co.uk/floatingfloors.html and this is the new ASP page that it should redirect to http://www.mason-uk.co.uk/floatingfloors.asp


So, the things are a bit different from your original description.
Try this:
Code:

RewriteRule /floatingfloors\.html http\://www.mason-uk.co.uk/floatingfloors.asp [I,O,RP]

Back to Top
 
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 22 September 2011 at 4:14am

THANKS LEXEY. Thats great! I wish I'd known about that bit at the beginning in the first place! I am a total beginer with these sorts of redirects. But never mind, its a major relief to finally get that bit of code sorted. I cant believe that no one mentions that bit in all the code I've looked at on the web for these types of redirects.

To do other files (some of the HTML files are in the root, most are in /pages/  directory)
do I just copy and paste the last line, changing the obvious bits?

For instance, if floatingfloors.html was in /pages/  would the code look like this:

RewriteRule pages/floatingfloors\.html http\://www.mason-uk.co.uk/floatingfloors.asp [I,O,RP]

or

RewriteRule /pages/floatingfloors\.html http\://www.mason-uk.co.uk/floatingfloors.asp [I,O,RP]

Or something else entirely?
I guess I can try those two out myself....


__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 
AblazeGraphics
Newbie


Joined: 16 September 2011
Location: United Kingdom
Posts: 9
Posted: 22 September 2011 at 5:16am

Actually I just got it to work fine with the /pages/ bit that you gave me before:

RewriteRule /pages/floatingfloors\.html http\://mason-uk.co.uk/floatingfloors.asp [I,RP]

Thanks again for your help!


__________________
http://www.mason-uk.co.uk
http://www.soundmaskuk.co.uk
Back to Top Visit AblazeGraphics's Homepage
 

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