# changing servers



## hypagoga (Jul 23, 2011)

Hi - this is my first post to the forum! I've done some searching on the web for an answer, but it gets pretty confusing because I haven't seen the exact question. In any case, here is my situation. I am webmaster for a biological research lab (I am actually one of the scientists - an entomologist - but dabble in web design, enough to keep it up to date and interesting). Recently, the process of a changeover to a new URL began, for the entire larger organization (our lab is just one part of this - the IT folks at the organization are happy to let me deal with the lab portion).

So as an example (not real values):

We had the following URL: www.organization.org/biology/entomology/

We got a new server, and started using: www.organization.org/science/entomology/

I am in charge of /entomology/.

Because such switchovers are slow at the organization level, both of these servers are still active and visible. That's because some of the other subdirectories in /biology/ have not made the switchover to /science/. I did it right away, and stopped updating /biology/entomology/. 

Since I did make the switch, currently there are 2 versions on the web - /biology/entomology/ and /science/entomology/. Of course search engines find the old one, which I do not keep up to date anymore.

I could go into each file and subdirectory in /biology/entomology/ and put in a manual redirect as a stopgap measure, but that seems like an AWFUL waste of time. So here's my question:

What is the best, most efficient, way to do the following:

Someone goes to www.organization.org/biology/entomology/staff/sjones.html or to www.organization.org/biology/entomology/seminars.html or even just to www.organization.org/biology/entomology/ (in other words, any subdirectory or file within /biology/entomology/)

and the result will be a seamless redirect to

www.organization.org/science/entomology/staff/sjones.html or to www.organization.org/science/entomology/seminars.html or to www.organization.org/science/entomology/.

Can anyone give me some advice?


----------



## hypagoga (Jul 23, 2011)

Wanted to bump this before it gets too far down the list and out of mind! Anyone have any insights?
:4-dontkno


----------



## hypagoga (Jul 23, 2011)

Argh! :4-dontkno 

I am wondering at least if this was a stupid question? (I don't mind if you tell me so :grin Or unclear? Or just impossible? 

Any insight will at least let me move on to the nuclear modifying-each-file-to-redirect option!

Thanks!


----------



## SABL (Jul 4, 2008)

Hi hypagoga!! Let's try a different area of TSF and see if we can get you an answer....the Web Design Team is pretty sharp!!


----------



## Laxer (Dec 28, 2010)

@OP, there are no stupid questions...

there are also no impossible solutions... just really really complex ones :laugh:

@SABL, We aren't that sharp.... :grin:

*------------------------------------------------------*

What type of web server are you running?

If its Apache we could create a mod-rewrite to automatically forward(301) Paths from the /entomology/ folder to /science/

the path inside the folder would have to be the same or it would spit out a "not found"(404) error.

Example:
/entomology/folder/text.php

would forward to:

/science/entomology/folder/text.php

Would this work for you?


----------



## Laxer (Dec 28, 2010)

Hopefully I didn't mess this one up 

Open up your .htaccess file (still assuming Apache)

and paste this code at the bottom:

```
redirectMatch 301 ^/entomology/(.+)$ http://www.YOURDOMAIN.com/science/entomology/$1
```
Note: you do need to adjust your domain....

After that save it and upload it to your server.

That should do it for you. If not let me know and I will whip up something else.


----------



## hypagoga (Jul 23, 2011)

SABL said:


> Hi hypagoga!! Let's try a different area of TSF and see if we can get you an answer....the Web Design Team is pretty sharp!!


I completely missed seeing the design forum! Thanks for flipping it over here!


----------



## hypagoga (Jul 23, 2011)

Laxer said:


> Hopefully I didn't mess this one up
> 
> Open up your .htaccess file (still assuming Apache)
> 
> ...


Thanks Laxer! I will try this and get back here about it. Unfortunately a couple weeks ago I wasn't so busy with work - now I'm swamped! May be a short time before I get to try it, but I'll post back when I do!


----------



## Laxer (Dec 28, 2010)

hypagoga said:


> Thanks Laxer! I will try this and get back here about it. Unfortunately a couple weeks ago I wasn't so busy with work - now I'm swamped! May be a short time before I get to try it, but I'll post back when I do!


No problem, just post something here and it will bump it up into view.

I am on quite frequently and can assist whenever I see the alert run across my screen :grin:


----------



## hypagoga (Jul 23, 2011)

OK - it's been a while, but I finally am trying to get back to this. Folks are annoyed that there are two versions out there, the older (and not updated) one being the one google hits. 

It is not an Apache server, but rather Microsoft IIS/6.0.

I've found good information about the settings to make a 301 (permanent) redirect. However, everything I've found wants me to do it directly through the server itself (seems relatively simple using Internet Services Manager). As I understand it, I would need to do the following:

For the virtual directory mapped to www.organization.org/biology/entomology/, I would configure it to be redirected to www.organization.org/science/$V. This $V would represent everything including /entomology/ and after.

The result would be that a request to www.organization.org/biology/entomology/staff/smith.html would automatically redirect to www.organization.org/science/entomology/staff/smith.html

That seems like it would work. BUT, I am using Dreamweaver CS5 from my desktop - the server is downtown. I access it via FTP. I could modify each file with a meta refresh, but I don't think that's the ideal method at all, in the longterm. 

So, do I have any options other than asking the downtown IT folks to do it for me? That would be sad...


----------



## Laxer (Dec 28, 2010)

You should have access to the server files remotely....

Who are you hosted through?

check the root of your site to see if you can find the file "web.config" you can set up the 301 redirect for the whole folder there.

If that's not their check your host for an IIS systems management or something along those lines.

If you have no access call them up and ask them to make it for you.

Just tell them you want a 301 redirect in the web.config file to redirect everything in /biology/entomology/ to /science/entomology/

Once this is done just delete the biology folder remotely. (I suggest keeping a backup locally.)


----------



## hypagoga (Jul 23, 2011)

Yeah - I'm going to have to have them do this. I have access to see the deeper levels, but not to make changes. I can only make changes at the /entomology/ level. That said, I didn't see a web.config file, but that may even be one level deeper than I have permission to see. Oh well. I will drop them an email. I'm pretty sure they'll do it - they are really happy that I deal with the /entomology/ section, which takes a load off their backs! If they won't, I'll just do the meta refresh method, at least as a temporary fix.

I'll let you know how it turns out. Thanks so much for your help!!


----------



## Laxer (Dec 28, 2010)

No problem! Keep me posted.... :grin:


----------

