foo.bar.com/baz/* -> new domain.com/*?
March 22, 2006 10:34 AM   RSS feed for this thread Subscribe

Is it possible to implement domain-part redirection on URLs, along these lines: http://foo.bar.com/baz/0001.html becomes http://new.domain.com/0001.html for any instance of "foo.bar.com/baz/*", that segment of the URL is replaced by "new.domain.com/*" If so, are there multiple methods? [MI]

I think that this is possible if you have httpd.conf access under apache; however, in the instance I'm trying to learn about, I do not have that level of admin access. I do have DNS control over the second domain, but not the first. The page set at the first domain is my content, hosted by a commercial aggregator.

I think I might be able to accomplish this by setting up a script at "new.domain.com" which would parse incoming URL requests and transfer the visitor to the "foo.bar.com/baz" URL.

Is there a readymade script I can gank to accomplish this?

can i do what i need just in DNS?

TIA!
posted by mwhybark to computers & internet (8 comments total)
If you don't have the ability to modify httpd.conf, can you change settings with .htaccess? If so, then this problem can be solved with mod_rewrite.
posted by justkevin at 10:39 AM on March 22, 2006


Assuming that apache is configured correctly, you can use a RedirectMatch directive in .htaccess

Something like:
RedirectMatch /baz/(.*)$ http://new.domain.com/$1
posted by rajbot at 10:50 AM on March 22, 2006


Thanks, I will try both these methods today and note what happens. I don't know offhand if our main domain host permits .htaccess.
posted by mwhybark at 11:02 AM on March 22, 2006


Just a note. Even if a host gives you .htaccess support, they may not let you put mod_rewrite or mod_alias rules there (though many do).

Another other option would be to create a bunch of dummy HTML pages to replace the originals that use a meta redirect to the new location. Not all that complicated, but I don't know of any ready-made scripts to do it for you.
posted by Good Brain at 11:10 AM on March 22, 2006


nope, .htaccess is disallowed. Shoot.
posted by mwhybark at 11:29 AM on March 22, 2006


Oh, hilarity. I just realized we already have DNS forwarding set up; the commercial aggregator renders their pages into frames which led me to overlook just testing to see if forwarding was already in place.

I'm placing a pancake on my head at this very moment.
posted by mwhybark at 11:39 AM on March 22, 2006


I'm placing a pancake on my head at this very moment.

What's the story behind that phrase?
posted by chazlarson at 12:06 PM on March 22, 2006


See this as a starter.
posted by mwhybark at 7:20 PM on March 22, 2006


« Older Tell me of the waters of Carbo...   |   Keyboard-centricFilter: I need... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
Free linux dynamic dns hosting? June 16, 2008
Why do I still see our old website even though the... February 3, 2007
How do I manage two domains on the same hosting... January 30, 2007
Domain names are fun! My company has over 60... March 16, 2004
I'm, finally, looking to register a (.com) domain... December 11, 2003