Very simple case but i dont have any ideas how i can do that

Using a single web hosting account to host multiple sites

Very simple case but i dont have any ideas how i can do that

Postby Menta2K » Thu Jun 28, 2007 7:21 am

I have domain domain1.tld
and wont to redirect only index to a different page
In example if someone try to open http://www.domain1.tld/index.html
to open the index page
but
http://www.domain1.tld/ to send him on http://www.domain1.tld/page01.html
I was thinking for something like that

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.tld$ [NC]
RewriteCond %{REQUEST_URI} ^$ [NC]
RewriteRule ^(.*)$ page01.html [R]

But that did not not work.
Menta2K
 
Posts: 4
Joined: Thu Mar 15, 2007 4:27 am

Postby richardk » Thu Jun 28, 2007 8:40 am

%{REQUEST_URI} always contains at least the first /, but you don't need %{REQUEST_URI} anyway.

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.tld$ [NC]
RewriteRule ^$ /page01.html [R,L]
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 65 guests

cron