Forum Moderators: phranque

Message Too Old, No Replies

ReWrite Help Required please

         

TeddyBare

9:10 am on Jul 5, 2004 (gmt 0)

10+ Year Member



I have read through the messages here, and while I can't find a solution to my (I think) simple problem, I feel sure someone here can help me

I have a couple of domains pointing to the same web hosting space. What I'd link it for the "main" page for each domain to be different, without having to use subfolders if possible. So, for example

[domain1.com...] would display index1.php and [domain2.com...] would display index2.php

from there, they might well share other files and folders, its just the first page loaded I need to change at this stage.

Anyone help please? I have an .htaccess file but my changes so far have either stopped all pages working or have made no difference at all.

Thanks!

gergoe

12:31 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



Try

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)$
RewriteRule ^$ index.%2.html [L]

This will rewrite empty requests to index.domain_name.tld.html. If no domain name specified for the request (requests prior to http\1.0) then the default rules aply, so index.html will be sent back. Here are some examples how it should work:

[domain1.com...] => /index.domain1.com.html
[domain1.com...] => /index.domain1.com.html
[domain2.com...] => /index.domain2.com.html
[subdomain.domain2.com...] => /index.subdomain.domain2.com.html
[subdomain.domain2.com...] => /index.subdomain.domain2.com.html

TeddyBare

7:23 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



Did the job nicely! Thank you!

I knew someone would know how.