I tried searching, but since I'm pretty new to networking I may not have used to right keywords, so I apologize if I missed the answer.

My friend owns a domain friendsmusic.com and I have hosting at mydomain.com/friend I want him to point to.

All my code uses relative paths, but I want to make sure when someone visits friendsmusic.com they see the page I'm hosting, but the URL in their address bar remains friendsmusic.com and when they click on the contact page the address bar reads friendsmusic.com/contact and not mydomain.com/friend/contact

At the moment NameCheap has an alias setup to my hosting, but it's resulting in a redirect loop. Note that I don't have any code which redirects.

Anyone know what the DNS/etc. settings should be?

2 Answers 2


The only solution I can think of here is a server alias.

A server alias points to your domain name on web server level. It can send the user somewhere without the URL changing

But you must note:

  • the domain should be hosted at your hosting company
  • you should redirect all links to example.php/. Note the /, otherwise the real URL will be shown.

It's a decent alternative for frames.


It's not strictly a DNS setting. You would have to change the settings on your web server.

You will need to have the friendsmusic.com DNS A record point to the IP Address that mydomain.com/friend is hosted at.

Then assuming you are using an Apache web server you can go into the configuration file example: /etc/apache2/apache2.conf and create a mod_rewrite condition. Similar to this. I suppose you might be able to create an .htaccess file instead of directly editing your server configuration file which you may not even have access to depending on your host. Check out this answer as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.