Question

First, I have already spent the past few hours trying to find a solution for this, but have had nothing but non-working solutions :(

It's pretty simple - I'm pointing the DNS of a new domain to my current hosting, but when I visit the new domain, I'm just viewing my original site (the one i got with my hosting).

Let's say my original site is "www.originalsite.com" - the content for my new domain is at "www.originalsite.com/newsite.com/" (dots included).

Now I just need to get "www.newsite.com" to re-direct to it's own directory AND re-write itself to hide the directory name.

So yeah, "www.newsite.com" needs to use the content in "www.originalsite.com/newsite.com/", but remain displayed as "www.newsite.com" in the URL bar.

Cheers for any input - really appreciated :)

PS: I'm using ColdFusion and previously made a useful re-direction, but the result was typically "www.netsite.com/newsite.com/" - which is not what I want :)

Oh...and yeah, I'm hoping for an .htaccess fix :) thanks!

Was it helpful?

Solution 2

CrystalTech have just recentely installed a mod that provides htaccess ...

Though they've only done it one server so far :) so I'm being moved onto that server.

Problem solved I guess - heh!

PS thanks for the help anyway guys :)

OTHER TIPS

If you have full control over the server, a VirtualHost in httpd.conf is probably a better solution. For example:

<VirtualHost newdomain.com:80>
    ServerName newdomain.com
    ServerAlias www.newdomain.com

    DocumentRoot /path/to/webroot/newsite.com

</VirtualHost>


If you don't have the ability to do this directly, any good host will provide a "Park Domain" function which allows you to achieve the same effect - specifying your new domain and identifying which directory you want it to point to - via the web control panel.


However, if you don't have the ability to do that, here's a mod_rewrite for .htaccess that should work:

RewriteEngine On
RewriteCond %{REMOTE_HOST} (www\.)?newdomain\.com
RewriteRule ^(.*)$ /newdomain.com/$1 [L]

You could do the redirect with a "cloaked" frame page. That way the URL in the browser's address bar stays the same (no extra path), and it remains simple to use the subdirectory.

The following link describes this for classic ASP - but it should be simple to convert to any server side scripting language/platform: http://www.simpledns.com/kb.aspx?kbid=1151

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top