digitaltinker
10-09-2000, 05:34 PM
I currently have two domains that point to the same IP address on my hosted account. I would like traffic from each respective domain name to have its own directory default page (i.e. index.html, home.html) What would the syntax be to modify my .htaccess file to do this? Below is the way to redirect to a sub-directory, but what I want to do is simply select the default page based on the URL (to host two domains on the account): It seems as though a combination of the RewriteEngine used with DirectoryIndex would do the trick but I don't know how to get the syntax to work.
Thanks for any help.
--------------------------------------
Add the following to the .htaccess file:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
# Rewrite Rule for machine.domain-name.net
RewriteCond %{HTTP_HOST} machine.domain-name.net$
RewriteCond %{REQUEST_URI} !machine/
RewriteRule ^(.*)$ machine/$1
This will redirect requests for the machine name machine.domain-name.net to the directory machine
on the site domain-name.net .
------------------------------------
and this will change the home page for all requests
------------------------------------
Different Default Home Page
Add the following to the .htaccess file:
DirectoryIndex filename.html
Then a request for http://domain-name.net/ would return http://domain-name.net/filename.html if it
exists, or would list the directory if it did not exist.
If you place your .htaccess file containing the DirectoryIndex specification in the root directory of
your site, it will apply for all sub-directories at your site.
Thanks for any help.
--------------------------------------
Add the following to the .htaccess file:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
# Rewrite Rule for machine.domain-name.net
RewriteCond %{HTTP_HOST} machine.domain-name.net$
RewriteCond %{REQUEST_URI} !machine/
RewriteRule ^(.*)$ machine/$1
This will redirect requests for the machine name machine.domain-name.net to the directory machine
on the site domain-name.net .
------------------------------------
and this will change the home page for all requests
------------------------------------
Different Default Home Page
Add the following to the .htaccess file:
DirectoryIndex filename.html
Then a request for http://domain-name.net/ would return http://domain-name.net/filename.html if it
exists, or would list the directory if it did not exist.
If you place your .htaccess file containing the DirectoryIndex specification in the root directory of
your site, it will apply for all sub-directories at your site.