URL redirection

Using a single web hosting account to host multiple sites

URL redirection

Postby Mercury » Sat Sep 02, 2006 2:45 am

I will soon have 1 hosting plan and 3 domain names.
It's possible to redirect every url to a certain subdomein.

I assume like this (in the .htaccess file):

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain2.ext$ [NC]
RewriteRule ^(.*)$ http://subdomain.domain1.ext/$1 [R=307,L]

Now my question, when you type the address http://www.domain2.ext, will it change to http://subdomain.domain1.ext in the address bar? Or will you still see http://www.domain2.ext.

Or another example if you go to http://www.domain2.ext/folder/file.php, will the url change to http://subdomain.domain1.ext/folder/file.php or will it stay like you typed it first?

What I want to know is, will the url in the address bar in your browser change to the 'ugly' url or will it stay as how you typed it.
If it changes, is there a way through mod_rewrite to let it be the "nice" url?

Thanks in adavance.
Mercury
 
Posts: 1
Joined: Sat Sep 02, 2006 2:38 am

Postby richardk » Sat Sep 02, 2006 4:38 am

It's a redirect, the URL will change.

You can either proxy the request (user P instead of R=307).

Or if the subdomain doucment roots are subdirectories of the main document root, you can use internal rewriting. (Provide the document root paths.)
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 89 guests

cron