Reputation: 8629
I want the url http://welcome.com (for example) to render the content from the url http://www.cleaning.com/welcome without redirecting to cleaning.com.
so when people go to welcome.com they see the content from http://www.cleaning.com/welcome but welcome.com remains in the address bar. how can I do that?
Upvotes: 0
Views: 106
Reputation: 18218
You can use JavaScript with jQuery to do this with code if you want. This way you do not have to alter your web server configuration. See the jsfiddle: http://jsfiddle.net/seMUj/1/. Although I agree with the comments above, you shouldn't do that.
HTML:
<div style="height:100%" id="a"></div>
JS:
$('#a').html('<object style="width:100%;height:100%" data="http://saltwatertides.com/">');
Upvotes: 0
Reputation: 6428
If both sites are on the same server, you could setup your virtual host for example.com
to have as DocumentRoot
the path to your cleaning.com/welcome
directory. How you accomplish this depends on your webserver. On apache, this would be something like:
<VirtualHost *:80>
#rest of config
DocumentRoot "/var/www/cleaning.com/web/"
ServerName www.cleaning.com
</VirtualHost>
<VirtualHost *:80>
#rest of config
DocumentRoot "/var/www/cleaning.com/web/example"
ServerName example.com
</VirtualHost>
If they aren't on the same server, you could use (I don't believe I'm saying this) framesets.
PS: framesets are obsolete on HTML5.
Upvotes: 1