Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

So I have a web hotel with 1 main website

and a few websites in subdirectories, in a folder called projects.

I have domain names pointing to the subdirectories, but when holding the mouse over a link in those websites the URLs are shown as:

When I'm on I want them to be shown as:

I spoke to support for the web hotel and the guy said try using .htaccess, but I'm not sure exactly how to do this.

Thank you very much for your time!

Edit: For more information

My website is: and I also own

All of's files are in:

When you visit, you'll notice all of the URL's point towards:

but I want them to point towards:

Can this be done? I hope this is enough info for you to go on :).

Edit: For w3d

I go to the url and the browser shows the url The services I'm using create an iframe around and use the url

I just hate that in Firefox and Internet Explorer, holding the mouse over link show that the destination url is:

share|improve this question
I have to close this for now because there isn't enough information here to help you. Without knowing all of the the potential URLs your site has it isn't possible to offer a solution. In the meantime you can look at a tutorial like this one to attempt to write yourself. – John Conde Feb 23 '14 at 17:36
I've added some more info to the question, I hope this en enough to answer :) I've had a look through the tutorial you linked, but I can't find anything in it that could help me with this – Richard Muthwill Feb 23 '14 at 18:00
Does the URL in the address bar show or, when you first visit Or are you redirecting? How do you generate your in-page links? – w3d Feb 23 '14 at 23:00
I added some more info for you @w3d! :) – Richard Muthwill Feb 23 '14 at 23:26
Unfortunately I don't think this can be done with .htaccess wizardry alone - you do need to actually change all those in-page links to the desired URL structure. However, the fact that these two URLs are on different domains are going to give you more trouble. IMO you need to get rid of the IFRAME and setup as an add-on domain (in cPanel parlance) to, pointing directly at – w3d Feb 24 '14 at 0:08

2 Answers 2

You can't hide your real URL because it's can risk many websites and users but you can make redirect page like that:

$url = $_GET['url'];
header('Location: '.$url);

and you can change the file name with the .htaccess

share|improve this answer

This is really something that the hosting ISP should re-point on their end:

<VirtualHost *:80>
    DocumentRoot /path/to/projects/mysubsite

You might be able to fix it in .htaccess:

RewriteCond %{HTTP_HOST}  ^www\.mysubsite\.com [OR]
RewriteCond %{HTTP_HOST}  ^mysubsite\.com
RewriteRule ^(.*) /path/to/projects/mysubsite/$1 [L]

Note that I did not include [R] in the flags passed to RewriteRule, as that would tell the webserver to send a redirect back to the web browser. If the two sites are on different servers, you would have to have mod_proxy enabled:

RewriteCond %{HTTP_HOST}  ^www\.mysubsite\.com [OR]
RewriteCond %{HTTP_HOST}  ^mysubsite\.com
RewriteRule ^(.*)$1 [P,L]
share|improve this answer
Thanks Joe, I'll try this :) – Richard Muthwill Sep 4 '14 at 19:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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