Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Redirecting a subfolder on a site to a new domain

301 redirect

         

McClaw

8:57 am on Jan 25, 2006 (gmt 0)

10+ Year Member



I am at the moment running a website to do with widgets

I recently decided to start a new subsite about completely different widgets as a subfolder of the main site.(To see if it would work)

The sub site has been doing really well, so I decided to create its own domain / website.

All the pages are .htm

My question is this:

Is it possible to redirect the subsite to the other domain without causeing issues for the original?

And if so, how would I do it?

add <META HTTP-EQUIV="Refresh" CONTENT="5; URL=http://www.newwidgets.co.za/newpage.aspx">

to [widgets.co.za...]

I can sticky the correct URLs to anyone interested in helping me out.

PS: "widgets" and "new widgets" have nothing to do with each other.

jimbeetle

4:08 pm on Jan 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If your server is running Apache you can include an .htaccess file in the subfolder on the current site and use mod_rewrite to redirect to the new domain.

Exactly how you would implement depends on whether you're keeping the same structure or not. Take a walk over to the Apache Web Server [webmasterworld.com] forum and look around. There are a lot of examples for redirecting in different situations and links to documentation you'll need to get a start.

walkman

4:25 pm on Jan 25, 2006 (gmt 0)



defintely NOT META HTTP-EQUIV="Refresh"; a 301 will do, but you'll probably upset the Google Gods who keep track of links.

georgei

8:29 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



If your webhost supports ASP or PHP languages, you can place an index.asp file into your subdomain folder with the following code:

<% Response.Redirect("http://newsite.com") %>

jonrichd

12:23 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Make sure whichever redirect method you use it ends up being a 301 redirect, not a 302.

For example, in ASP, use:

<%@ Language=VBScript %>
<%Option Explicit%>
<%
Response.Status = "301 permanent redirect"
Response.redirect "http://www.mysite.com/newpage.asp"
Response.End
'%>

If it's a 302, Google will see two pages with the same content, and will likely stay with the first one it found.

McClaw

7:17 am on Jan 26, 2006 (gmt 0)

10+ Year Member



The problem I have is that all the pages are htm pages hosted on a IIS server.

is there any way of doing it on a htm page without using server side code?

otech

8:15 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Yes, you can do it from the IIS manager in control panel.

In the Home Directory tab of the old folder, select:

A redirection to a URL
Then tick:
The exact URL entered above
A permant redirection for this resource

Then in the redirect to field enter:
[newdomain.com$S$Q...]

This will pass any folders /files or paramaters to the new site aswell so it redirects to the correct page.

Hope this helps, if you dont have access to IIS Manager (ie you dont host it yourself) then get your Hosting Co to do it for you.

This way works a treat and even forwards old backlinks & PR to the new urls as well.

Leaving off the $S$Q would make all pages redirect to the new default file in the root directory only.

McClaw

8:25 am on Jan 26, 2006 (gmt 0)

10+ Year Member



can I do this on only a subfolder of the site?

I dont want to redirect the whole site, just a subfolder.

search on google for sulaco my site comes up first, if you want to have a look (I hope i'm alowed to do this *confused*

McClaw

11:10 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Ahh
I figured it out :)

The IIS redirect works perfectly

Thanx for all the help :)